|
|
|
|
|
by mwattsun
1640 days ago
|
|
There is a principle which is a bar against all information, which is proof against all argument and which cannot fail to keep a man in everlasting ignorance. This principle is contempt prior to examination -- Herbert Spencer, 19th century English philosopher, scientist, and theologian I've been attempting to train myself to be more open minded. For example, I have been skeptical of functional programming because my assumption was that it was an academic thing for those that didn't have to live in the real world of state and mutability. I thought it had to be less efficient. Some investigation proved me wrong. Russ Olsen set me straight: Functional Programming in 40 Minutes • Russ Olsen • GOTO 2018 https://www.youtube.com/watch?v=0if71HOyVjY We don't have to copy a million element immutable array to change one element. We copy a section of it and keep the rest in a tree structure of changes (this happens under the covers). Secondly, manipulating the stateful world is easier to understand if we isolate those actions in Atoms and Actors. Now I see the beauty of it so I'm glad I investigated. |
|
The key idea of functional programming is that it’s easier to think of program as a composition of functions rather than as a list of statements and therefore functions should be first class values. That used to be controversial but frankly the idea won. We have seen lambdas go mainstream in most major languages and programming is more and more functional by the day.