|
|
|
|
|
by lijok
1031 days ago
|
|
> like saying functions should be immutable then also saying the ideal function has 0 arguments, apparently mutating the class doesn’t actually make the function mutable to Bob Martin! What does "functions should be immutable" have to do with mutating classes? |
|
The best example of a function without side effects would be sin(x). You call the function with an input and it returns a completely new output. The function should be thread safe and easy to isolate because it never touches any outside state.