3 ms·
So the biggest benefit Hague derived from functional programming, by his own account, is that the headache it gave him crippled his zeal for clever tricks. It'
by atdt 14y ago
So the biggest benefit Hague derived from functional programming, by his own account, is that the headache it gave him crippled his zeal for clever tricks.
It's a bit like making friends in a new language: when your tongue is tied, your interactions with others are sometime marked by this naive, disarming honesty that is charming and uncomplicated and utterly impossible to reproduce in your native tongue. It's sometime tempting to ascribe that to language itself, but it's not inherent to the language -- it's circumstantial. As you become fluent, shades of irony and evasion creep back into your speech.
Functional programming comes with its own bag of clever-clever tricks, and lack of familiarity will only stay your hand from them for as long as you lack familiarity. Ignorance is ephemeral. Contending with arbitrary handicaps may be formative, but it can't (and shouldn't) drive adoption.
- look_lookatme 14y agoNothing to contribute, just want to say this is a wonderful comment.
- mbrock 14y agoYes, quite perfect!
- silentbicycle 14y agoHe's said something pretty similar about J: "I highly recommend that all programmers learn J. I doubt most will end up using it for daily work, but the process of learning it will stick with you. J is so completely different from everything else out there, and all your knowledge of C++ and Python and Scheme goes right out the window, leaving you an abject, confused beginner. In short, J will make you cry." (http://prog21.dadgum.com/48.html http://prog21.dadgum.com/48.html) While I think multiparadigms are very practical, the easy availability of familiar approaches is a weakness when using them for studying programming.
- Peaker 14y agoIn the article "Why Functional Programming Matters"[1] John Hughes explains the benefits of the "no destructive assignments" handicap. Basically, having no assignments yields new ways to glue code together. It is somewhat similar to the benefits of structured programming as opposed to goto's. Also, functional languages such as Haskell don't forbid mutability/effects, they just make them explicit. This is only a handicap in the sense that it makes some types of changes more difficult (e.g: Adding an effect to code that previously did not have one). But this has enormous advantages, because there are so many interesting things we can do when we have the guarantee that things have no effects when they actually don't. [1] http://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf http://www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pd...
- JackC 14y agoI just read through most of O'Reilly's new Clojure book and implemented a simple Clojure app (a web-based tic-tac-toe game). The analogy to making friends in a new language is really good -- it was full of moments like "I'm sure somewhere in this dictionary is the perfect word for what I'm thinking" and "you have a word for that?!" and "I never would have thought of putting things that way!" The primary consequence was to improve my use of my native language, Python -- I'm much more likely to use all() and any() and map() and reduce() and set() where they make sense, to think of my functions in terms of composability, etc. I'm not sure that I'll ever put in the time to be fluent in Clojure, but I'm glad I spent some time stumbling through it.
- eru 14y agoSlightly off-topic: In Python you will also benefit from using the sorted and reverse functions to avoid mutability. Generator functions are a nice way to build collections without using explicit append: def collection (): list = [] while someLoopCondition (): while someOtherLoopCondition (): list.append (someStuff ()) return list vs def collection2(): while someCondition (): while someOtherLoopCondition (): yield someStuff ()