11 ms·
To me, as long as functions are first class members, and higher-order functions are possible, I consider a language to be functional. Everything else is a conv
by theGimp 10y ago
To me, as long as functions are first class members, and higher-order functions are possible, I consider a language to be functional.
Everything else is a convenience and not a requirement for the functional paradigm.
Mind you, I do much prefer a Lisp or Scala to Javascript, but I face no trouble writing functional code in Javascript.
- platz 10y agoOk, just be aware that by that definition, just about every language that wasn't developed in the stone ages would qualify.
- theGimp 10y agoI did not know COBOL was functional too :) Out of curiousity, what other criteria would you apply?
- sotojuan 10y agoNot the one you replied but I was taught through university and books that functional programming's most important feature is the discouragement of side effects. Even on Wikipedia it's said to be a style of programming that "avoids changing-state and mutable data". I'd put discouragement of side effects and immutable data up there with higher-order functions (HOFs). You're more than welcome to have your own definition, but it's my opinion that it's too broad since HOFs exist in some form in languages like Java and Ruby and I wouldn't call them functional though like another commented said, languages are mixing paradigms nowadays (with the exception of Haskell!).
- bunderbunder 10y agoYup. The same is roughly true for being object-oriented. The big paradigm divisions were largely a thing of the 1990s; since then languages have become increasingly multiparadigm, so that it's almost hard to find a language that isn't nowadays. I think Haskell and Golang might be just about the last remaining standard-bearers of the league of one-trick ponies.