4 ms·
Eliminating side effects is about a lot more than variable scope. One example would be reading from/writing to a file.
by MidsizeBlowfish 12y ago
Eliminating side effects is about a lot more than variable scope. One example would be reading from/writing to a file.
- dustingetz 12y agoI think it's an accurate description. The OS code that reads a file involves changing variables outside function scope, eg pointer writes to memory mapped hardware. Simply forcing all variables to be final, all the way down, really does eliminate all side effects.