4 ms·
TLDR: write better code functional programmers get to express their ideas as code imperative programmers are so busy playing whack-a-mole with their bugs that
by dustingetz 14y ago
TLDR: write better code
functional programmers get to express their ideas as code
imperative programmers are so busy playing whack-a-mole with their bugs that they don't have time to think about new ideas
just look at the research[1] coming out of the <del>Clojure</del> functional programming community - especially Datomic. once you learn how to get your defect rate under control, you have time to explore crazy awesome new ideas
[1] https://thestrangeloop.com/archive/2011
[1] https://thestrangeloop.com/archive/2012
edited
- mkrecny 14y agointeresting - do you have a resource / starting point for diving into some of this research?
- MatthewPhillips 14y agoMost bugs have nothing to do with the code being imperative.
- dustingetz 14y agohttp://www.infoq.com/presentations/Simple-Made-Easy http://www.infoq.com/presentations/Simple-Made-Easy (this is so fundamental to this topic that it is required watching to even have an opinion on this subject) http://clojure.org/rationale http://clojure.org/rationale http://www.dustingetz.com/2011/05/05/how-to-become-an-expert-swegr.html http://www.dustingetz.com/2011/05/05/how-to-become-an-expert... http://www.dustingetz.com/2012/10/07/java-sucks-because-idiomatic-java-is-bad-code.html http://www.dustingetz.com/2012/10/07/java-sucks-because-idio...
- MatthewPhillips 14y agoYou don't have to convince me of OOP's faults; Clojure is my favorite language. But I write code for a living, mostly in OOP because that's where the jobs are, and I do not write very many bugs caused by OOP's poor design. I write bugs when the business is ill-defined, or when I misunderstand how a library's APIs are supposed to work, or when I'm careless and don't consider "what do I do if this function returns false"; all stuff that will come up in FP as likely as it will in OOP.
- D3 14y agoYes they do.
- dbaupp 14y agoLanguages like Haskell show this tendency too, e.g. Oleg's work[1] (which includes research with lisps) although he also does awesome stuff with imperative languages too. [1]: http://okmij.org/ftp/ http://okmij.org/ftp/
- danieldk 14y agofunctional programmers get to express their ideas as code imperative programmers are so busy playing whack-a-mole with their bugs that they don't have time to think about new ideas Stop drinking the cool-aid. Functional programming solves a lot of typing errors (if the given language has stronger typing than an imperative language) and makes composition easier in some cases (if the language is lazy). But: an algorithmic error is still an algorithmic error, an incorrectly designed data structure is still an incorrectly designed data structure. No matter what language you use. In addition to that, you get back a different set of problems: e.g. you have to reason about when something gets evaluated in a lazy regime in order for your program's heap not to blow up, and the translation to machine code is often not nearly as simple as an imperative language, which makes it harder to optimize functional programs. (Ps. I love functional programming.)
- pnathan 14y ago> functional programmers get to express their ideas as code The flaw is in us. Our ideas are malformed and flawed. Simply expressing ideas is not enough.