3 ms·
Not a downvoter, but I believe "Without side effects you couldn't do anything" means that any interesting program ultimately has a side effect. The rocket is l
by mturmon 13y ago
Not a downvoter, but I believe "Without side effects you couldn't do anything" means that any interesting program ultimately has a side effect. The rocket is launched, the form is printed, pi is displayed on the monitor, etc.
- kazagistar 13y agoIsn't that an effect, not neccesarily a side effect?
- mturmon 13y ago"Function with side effect" is a term of art in functional programming. It's a function which (like all other functions) takes in arguments and puts out arguments (that's the "effect", if you like). But also, with a "side effect" -- the simplest example being, display something on the monitor. I.e., (display "hello world") returns whatever it returns (we throw it away), but also puts that string on the monitor. The latter action is not just computing a function (in the sense of FP) of the inputs. For more, see http://www.eecs.berkeley.edu/~bh/ssch20/io.html http://www.eecs.berkeley.edu/~bh/ssch20/io.html (search for "side effect").