3 ms·
Enlighten us, please
by turminal 5y ago
Enlighten us, please
- zabzonk 5y agoAny function that does not return a value must have a side effect, else why call it. Calling functions that have side effects (and particularly don't indicate if the side effect was succesful), is not a great idea.
- torstenvl 5y agoAre there any software projects of substantial scale that are purely FP? Even things like I/O or dynamic memory allocation have side effects. So while FP has some great ideas implemented at scale (first class functions and MapReduce perhaps the most well-known), they don't seem very useful by themselves. EDIT: I'm not objecting to the idea "functions should return information," I'm objecting to the idea that side effects are "not a great idea."
- zabzonk 5y agoYou generally want to test if an "I/O or dynamic memory allocation" worked. BTW, I am basically a C++ programmer, not some functional maniac. But whenever I see a void return type, I think something is wrong.