3 ms·
> I wonder if this is why you tend not to see functional programming languages more broadly used...? The overarching problem is that functional programming tra
by bsder 2y ago
> I wonder if this is why you tend not to see functional programming languages more broadly used...?
The overarching problem is that functional programming trades extra thought now for extra benefit later.
Inexperienced programmers hate functional programming because they like "magic". They are having a tough enough time just getting the task at hand finished and the more stuff done for them without thinking, the better.
Inexperienced programmers don't want to think about multiple threads. They don't want to think about the event loop or sockets. They don't want to think about the state of the protocol and why it shouldn't update multiple steps. etc.
The only way for that kind of magic to happen is to have a bunch of implicit state that sits invisibly in the background. It's either global or part of a single mega-struct that might as well be global.
However, if an inexperienced programmer sticks around long enough they eventually run into a Heisenbug that is difficult to replicate. In order to run down the bug, they start having to isolate everything. Suddenly, the words of the old greybreard start coming back: "Immutable is good" "Time needs to be an explicit part of your state" and "bytes in, bytes out--putting the bytes on the wire is a different function" and ...
At that moment, they become an acolyte of functional programming and now qualify as an experienced programmer.
- trealira 2y agoNot all experienced programmers become functional acolytes. See: Ken Thompson, Donald Knuth. They like procedural programming and prefer to model programs with imperative, mutable state, rather than pure functions that map one type to another.
- desumeku 2y agoNeither is Richard Stallman.
- slowmovintarget 2y agoRichard Stallman is known more for his clarity of thinking about individual freedom and its likely abridgements that can arise as a result of using commercial software, than his chops as a coder. I could be mistaken, though.
- JohnFen 2y agoTrue. For my part, I'm genuinely impartial about this. Functional programming is fine by me, and so is procedural, object oriented, etc. They each have their own set of advantages and disadvantages.