|
|
|
|
|
by Homunculiheaded
5259 days ago
|
|
"Yet functional languages never really made it to the mainstream" JavaScript development these days is getting pretty darn close to what I would consider 'mainstream' functional programming. Heavy use of both first class and lambda functions, and closures have been standard practices for years now. And thanks to libraries like Underscore.js partial application and the use higher order functions like map/filter/etc are also becoming very common place. I'll absolutely agree that what we see is not 'pure' functional programming but neither is a good deal of real world Common Lisp. Anyone who has done a lot of programming in Lisp or Haskell has probably bemoaned the fact that many people are quick to dismiss so many great and useful tools these langauges provide. But I definitely think we're starting to see a trend where the most genuinely useful features of fp are becoming mainstream. |
|
I don't know, in general, that they're the "most useful" if utility is defined as conferring the ability to write better programs more quickly, more understandably, &c. But they are "most useful" in the sense that they confer such benefits with a minimum learning curve and with little deviation from the already understood mainstream programming paradigm. For example, monads are an incredibly useful feature, but the (perceived) barriers to understanding are high enough that no mainstream language will feature them as centrally as Haskell does.
I don't mean this as a sleight against anyone, at all—merely as a description. There are a lot of useful things which are outside the purview of the mainstream, and there's no reason to expect that nonetheless useful features of fp will necessarily make it into the mainstream. (And there are certainly cases where functional programming as a whole, and not just cribbed features, is desirable and advantageous, as in Jane Street's case, so I do hope that more non-academics come to see it as a valid paradigm for certain tasks.)