[Haskell-cafe] Elevator pitch for functional programming

Aaron Tomb atomb at galois.com
Wed Jan 21 00:22:19 EST 2009


On Jan 20, 2009, at 7:35 PM, wren ng thornton wrote:

> Jim Burton wrote:
>> Hi, I will be a TA on a comparative PL course and I'm looking for
>> small examples (ammunition) which motivate the use of Haskell and
>> functional programming generally. The course is for 1st year Software
>> Engineers, none of whom are likely to have used a functional
>> language. They will all have experience programming Java and a little
>> C++, with a few of them knowing Python, Ruby, PHP etc etc too.
>
> It's getting to be something of an old hat these days, but one of  
> the most powerful selling points I've seen for purity (and strong  
> types) is QuickCheck (and SmallCheck, LazySmallCheck,...). This  
> entire paradigm of testing makes writing tests trivial and can only  
> work right for pure functions.
>
> I don't know if your students are just students or if they have some  
> real software engineering experience, but anyone who's hacked on  
> Perl, Python, Ruby, Java, or C++ enough to earn the title would be  
> immensely impressed by how purity eases debugging.

I second this! For all of the wonderful benefits Haskell has, this is  
the one I miss most when programming in another language.

For an example of how hard it is to accomplish something like this in  
Java, check out JCrasher: http://ranger.uta.edu/~csallner/jcrasher/.  
Much less powerful, and much more work.

Aaron


More information about the Haskell-Cafe mailing list