Follow-up to “Functional Programming Doesn’t Work”
Programming in the 21st Century - James Hague - December 30, 2009Not surprisingly, Functional Programming Doesn’t Work (and what to do about it) started some lively discussion. There were two interesting “you’re crazy” camps:
The first mistakenly thought that I was proposing fixing problems via a judicious use of randomly updated global variables, so every program turns into potential fodder for the “Daily WTF.”
The second, and really, the folks in this camp need to put some effort into being less predictable, was that I’m completely misunderstanding the nature of functional programming, and if I did understand it then I’d realize the true importance of keeping things pure.
My real position is this: 100% pure functional programing doesn’t work. Even 98% pure functional programming doesn’t work. But if the slider between functional purity and 1980s BASIC-style imperative messiness is kicked down a few notches—say to 85%—then it really does work. You get all the advantages of functional programming, but without the extreme mental effort and unmaintainability that increases as you get closer and closer to perfectly pure.
That 100% purity doesn’t work should only be news to a couple of isolated idealists. Of the millions of non-trivial programs ever written—every application, every game, every embedded system—there are, what, maybe six that are written in a purely functional style? Don’t push me or I’ll disallow compilers for functional languages from that list, and then it’s all hopeless.
“Functional Programming Doesn’t Work” was intended to be optimistic. It does work, but you have to ease up on hardliner positions in order to get the benefits.
Categories: Blogs Programming in the 21st Century
Comments
So what else is new ? The reason we have so many impure functional langs, is that pure functional is hard. What is the sensation? Meet Lisp,Scheme, OCaml, Clojure, etc (maybe even Python to some extent).
I think that by definition of “pure” - it is very hard to get 100% of it, and it is much more easy to get, say 98% than 100% purity in nature. Only God is pure. The rest of us will always have to compromise.
Perhaps you should have titled it “Pure functional programming isn’t practical”. From what I’ve read, most “pure” implementations of the lambda calculus eventually backed down from it or added “impurities” to it to make it practical. You have to do I/O to do anything interesting.
Posted by Sean Cribbs on 01 Jan 2010 at 17:34I have no idea what you guys are talking about
Posted by Malaysia Insider on 11 Jan 2010 at 17:49admire the valuable information you offer in your articles. I will bookmark your blog and have my children check up here often. I am quite sure they will learn lots of new stuff here than anybody else!
drink coasters
I actually still need advice, myself! I’m not qualified to answer that one, except to say - just film it! just keep doing it so that you develop the skills.
PHP Programmer Montreal
Its a nice post regarding law and its values.I think its necessary to each and individual to follow the law and order.
Jumping Castle
Add comment
Erlang on Twitter
» TheColonial (OJ): Might not get to continue work on part 2 of my WebDAV in erlang series tonight. Have to sort out tax for tomorrow :(
» pipes2plagger (pipes2plagger): higepon:Cybozu Open Source: Released ordered KVS Mio 0.0.1alpha http://ow.ly/2AlIR #erlang #kvs: higepon Cybozu Op… http://bit.ly/cLLDwJ
» sugamasao (すがまさお): RT @higepon: Mio は Erlang で書きました。Erlang って実際どうよ?という方はコードを見てみると面白いかも。
» higepon (higepon): Mio は Erlang で書きました。Erlang って実際どうよ?という方はコードを見てみると面白いかも。
» repeatedly (tama (就職活動なう)): mio is a KVS written by Erlang…
» achonkgroup (M. Riza maulana): Dia anjing bukan? RT @dodiuchiha: erlang yg mata 3 cong RT @achonkgroup: Saya anjing donk?*sialan Haha” RT @dodiuchiha: siap dewa erlang hha
» dodiuchiha (dodi meidian k): erlang yg mata 3 cong RT @achonkgroup: Saya anjing donk?*sialan Haha” RT @dodiuchiha: siap dewa erlang hha RT @achonkgroup: Kalo panglima
» random_oracle (TELL): RT @higepon: Cybozu Open Source: Released ordered KVS Mio 0.0.1alpha http://ow.ly/2AlIR #erlang #kvs
» achonkgroup (M. Riza maulana): Saya anjing donk?*sialan Haha” RT @dodiuchiha: siap dewa erlang hha RT @achonkgroup: Kalo panglima tien feng berulah, bilang saya kakak2 sek
» dodiuchiha (dodi meidian k): siap dewa erlang hha RT @achonkgroup: Kalo panglima tien feng berulah, bilang saya kakak2 sekalian. Nanti saya laporkan dia ke khayangan RT
Statistics
Number of aggregated posts: 10081
Number of comments: 554
Most recent article: September 03, 2010
Latest comments
» Nissan Frontier Superchager on Erlang Doesn’t Fit The JVM: I don’t believe it is the silver bullet that fixes all the problems that required you to do your JVM tuning….Nissan Frontier Superchager
» Nissan Frontier Superchager on What to do About Erlang's Records?: The general solution is to delete all the keys that should have new values, then insert the new key/value pairs…
» videomob on Java And Threads (Jetty): Хватит спамить, накинулись