4 ms·
Subversion: Functional programming is popular because it's intuitive! Perhaps "immanent" or "diagrammatic" is a better word than functional. I mean that a fun
by maxbendick 5y ago
Subversion:
Functional programming is popular because it's intuitive!
Perhaps "immanent" or "diagrammatic" is a better word than functional. I mean that a function _is_ what it does, but not so with a procedure. One cannot bake a value as one does a cake!
See React's dominance. See the usefulness of declarative state machines. See async/await.
Functional programming gets a bad rep. People often fail to see the functional elements in more imperative code and the imperative elements of more functional code. In fact very few language constructs are necessary to open up 99% of functional possibilities in imperative languages (functions as values) or imperative possibilities in functional code (do-notation). Any critique that dismisses one or the other misses the point.
May add more explanation later.
- pharmakom 5y agoYes indeed! How many times have you heard these two statements from the same individual? “I don’t need all those functional features” “I don’t need a functional language because X has taken all the important functional features from language Y”
- TeMPOraL 5y ago> Functional programming is popular because it's intuitive! I mean that a function _is_ what it does, but not so with a procedure. One cannot bake a value as one does a cake! I suppose it really depends on what you've learned first. Myself, I started programming (C++) in my early teens, a bit before I was introduced to the concept of a function in math classes. I didn't have much problems with that part of math, but I knew something doesn't feel right about it. Only many years later I realized that I never fully internalized the concept of mathematical function being a relationship and not a procedure. And I had the same issue with "=" symbol. After being exposed to the concept of assigning values to variables in imperative programming, it took me years before my brain fully internalized the concept of equivalence relationship.
- hasmanean 5y agoMaybe the problem is that we evaluate functional programming as a way to write programs, but it’s real potential is that it gives us more ways to rewrite programs. That’s more useful long-term.