←back to thread

296 points gyre007 | 1 comments | | HN request time: 0.213s | source
Show context
flowerlad ◴[] No.21283724[source]
Functional programming is not new, it has been around for many decades. The reason it didn't catch on is because it doesn't map very well to how our brain works. Human brains are object oriented, so OOP is very easy to grasp.

The real question is, why are people now taking a second look at functional programming. And the answer is Moore's law. Moore's law is coming to and end, and CPUs are not getting faster. Instead they are adding more and more cores. To take advantage of lots of cores you need concurrency. OOP is not very concurrency-friendly because objects have state, and to avoid corrupting state in a multi-threaded environment you need locks, and locks reduce concurrency. Functional programming doesn't have state, so you don't need locks, so you can get better concurrency.

replies(4): >>21283758 #>>21285545 #>>21286055 #>>21286061 #
1. johnisgood ◴[] No.21286061[source]
Why would you need functional programming for that? Ada has extremely easy-to-use language constructs for concurrency.

Just to dive into Ada/SPARK: https://docs.adacore.com/spark2014-docs/html/ug/en/source/co...