News for hackers. Stuff that matters.
Re:You, Too, Can Be on the Cutting Edge of Functional Progra... by atdt on Wednesday May 09, 2012 @04:49AM (#3947633)
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.

Re:You, Too, Can Be on the Cutting Edge of Functional Progra... by silentbicycle on Wednesday May 09, 2012 @07:15AM (#3947992)
He'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)

While I think multiparadigms are very practical, the easy availability of familiar approaches is a weakness when using them for studying programming.

Re:You, Too, Can Be on the Cutting Edge of Functional Progra... by Peaker on Wednesday May 09, 2012 @08:23AM (#3948176)
In 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.pd...

Re:You, Too, Can Be on the Cutting Edge of Functional Progra... by JackC on Wednesday May 09, 2012 @09:54AM (#3948547)
I 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.

Re:You, Too, Can Be on the Cutting Edge of Functional Progra... by eru on Wednesday May 09, 2012 @11:09AM (#3948907)
Slightly 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 ()
Re:You, Too, Can Be on the Cutting Edge of Functional Progra... by look_lookatme on Wednesday May 09, 2012 @05:53AM (#3947801)
Nothing to contribute, just want to say this is a wonderful comment.
Re:You, Too, Can Be on the Cutting Edge of Functional Progra... by mbrock on Wednesday May 09, 2012 @08:31AM (#3948203)
Yes, quite perfect!