Live data from Hacker News

Why Functional Programming is not more widely used in industry?

news.ycombinator.com

1–10 of 21 posts

Re: Why Functional Programming is not more widely used in industry?

#2
First, I think functional programming is used more often than you realize. Not _pure_ functional programming, to be sure, but the use of functions instead of objects is found in tons of real-world software.

Now, as to why pure functional programming is not used, well it's the same reason why pure anything is not found much outside of academia, or why there aren't always unit tests, or why there is still lots of procedural programming. The software gets written in a hurry, by lots of different programmers with different levels of experience, and they do it in different ways. Some of them use a functional style, and some use objects, and some use bubble gum and duct tape.

Re: Why Functional Programming is not more widely used in industry?

#3
Because it's hard and non-obvious. Nothing in the real world works this way (including computers). It's mathy, it's hard like math, it's beautiful like a proof, but that only works for the small subset of the population who want to be mathematicians. Maybe there's some brain structure thing where this works better for 5% of the population. Maybe their biologically wired implicit grammar processor in their brain is a little different. Maybe in the next century we'll find a gene for 'functional programmer'. But it still just doesn't work for the majority of people. If it works for you, rock on with that for your solo work or find a group of likeminded people and do something with them, but I think it's just not going to have appeal to most people.

Re: Why Functional Programming is not more widely used in industry?

#7
One of the reasons could be that most programming languages do not have immutable datastructures by default, and most students are taught to progam within a "mutable" environment. Isn't of the first things they teach at schools about "variables", symbols which refer to locations in RAM which might change their contents at any time (at languages like C, Java and C#)?

I think Rich Hickey calls this "place oriented programming" ;)

It is funny how mathematical formulas do not have a "return" statement, they are just evaluated. Math doesn't have an assignment operation either.

Re: Why Functional Programming is not more widely used in industry?

#9
Because for the vast majority of software, fast to build is far more important than provably correct.

Because there aren’t any batteries-included RAD frameworks in functional languages yet.

Because most undergrad degrees, if they touch on functional programming at all, do so in only a cursory manner.

Because for most purposes a smart CTO will choose to develop a project in a language/framework that’s good enough and for which it’s relatively easy to hire skilled developers over a language/framework that offers some minor technical advantages but will make hiring even more excruciating than it is for widely-used tools.

Post reply on HN