3 ms·
Isn't FP simply too esoteric to ever become properly mainstream?
by jahaja 7y ago
Isn't FP simply too esoteric to ever become properly mainstream?
- AlexCoventry 7y agoYou can get 98% of the benefits of FP with 0% of the category theory.
- DonaldPShimoda 7y agoYou can also get many of the benefits of category theory without learning any of the category theory. :)
- DonaldPShimoda 7y agoNo, definitely not. FP concepts are catching on in mainstream languages. Lots of languages now support optionals instead of implicit nulls, maps and filters over lists, higher-order functions, etc. These all originated in FP and have just made their way over to the more mainstream imperative languages. Not only that, but FP is must more a state of mind than a set of language features. You can write functional code in practically any language, really, although some of them will make it easier than others.
- jahaja 7y agoLooking in from the outside, I just can't see how a project written in most esoteric-leaning languages can scale beyond like 5 developers without becoming an unreadable mess simply due to the expressiveness of the language.
- DonaldPShimoda 7y ago> I just can't see how a project written in most esoteric-leaning languages can scale Well what do you mean by "esoteric-leaning"? It seems like you just mean "languages I'm not used to", which is a very limiting perspective, but perhaps I've misinterpreted you here. Obviously nobody thinks you should write your production code in Brainfuck (which is an actual esoteric language). But there are plenty of places that use functional languages in production. Functional language are not esoteric by nature — they're just different. It's like calling SQL an esoteric language just because you're used to Java. Jane Street uses OCaml for everything, Facebook uses Haskell and ReasonML (which is really OCaml), Galois uses Haskell, Microsoft has F# and F* and a Haskell group, GitHub uses Haskell... There are plenty of examples of functional languages in industry. They're not esoteric, and they do scale when implemented correctly (same as anything else). > without becoming an unreadable mess simply due to the expressiveness of the language. ...? I don't mean this rudely, but are you sure you know what "expressiveness" means? More expressive languages are not inherently more or less readable than other languages. They simply enable you to do things you couldn't do in those other languages. C is more expressive than, say, x86 assembly by the inclusion of features like types. Do types make your code less readable? I don't think so. Java is more expressive than C by the inclusion of classes. Do classes inherently make your code less readable? I don't think so. Haskell is more expressive than Java by the inclusion of higher-kinded types. Do HKTs inherently make your code less readable? Not if you know what they are and how to use them — which you would if you use a language that supports them. So I don't think so.
- VHRanger 7y agoFP shouldn't be thought of as orthodox Haskell. It's more about the higher level concepts of having stateless code and pure functions where you can and isolate the stateful/impure parts. You can use these design techniques in any language you want.