Second, pure functions tend to be simpler to test.
If you want to change selection, open document below and click on "Move attachment"
1.2 Elements of Programming non-pure function example above that print
does not return a useful result when used in an operand expression. On the
other hand, we have seen that functions such as max , pow and sqrt
can be used effectively in nested expressions.
<span>Second, pure functions tend to be simpler to test. A list of arguments will
always lead to the same return value, which can be compared to the expected
return value. Testing is discussed in more detail later in this chapter.
|status||not read|| ||reprioritisations|
|last reprioritisation on|| ||suggested re-reading day|
|started reading on|| ||finished reading on|