2 ms·
> why just using map/filter/reduce and avoiding state is enough for code to be called "functional programming" A better term would be "programming with functio
by mcphage 9y ago
> why just using map/filter/reduce and avoiding state is enough for code to be called "functional programming"
A better term would be "programming with functions as first class citizens", but many years ago that got shorted to "functional programming".
> Most functional languages feature pattern matching, algebraic data types, purity, currying, strong typing, type inference, recursion instead of loops and types that cannot be null.
That's a list of what many functional languages now contain, although most don't contain all of those. But that isn't the list of "common functional programming language features" from 10 years ago, and isn't necessarily what the list will be in 10 more years, either.
- dawidloubser 9y agoWell... for some of us, when you say "functional programming", you say "Haskell". And it certainly had all of those features, and much more, more than 20 years ago. I really like another poster's recommendation that it be called "combinator-oriented programming". Because, while ES, Java, and even Rust, supports rich combinator-oriented programming, I wouldn't dare call any of them functional programming languages. Though, one has to admit, with ES6 now even supporting elegant currying, coupled with a good functional programming library like Ramda, and immutable data structures (Immutable JS), ECMAScript comes pretty close if you really want it to. The difference is, any code anywhere can "drop out of" the functional world, whereas a functional language like Haskell enforces functional purity throughout. Good times to be a software engineer, nevertheless!
- mcphage 9y ago> Well... for some of us, when you say "functional programming", you say "Haskell". Haskell is a single, functional programming language. It is not the definition of what a functional programming language is. If you mean Haskell, say Haskell. But don't try and redefine "functional programming" to mean "this one specific functional programming language that I happen to like".