Hacker News new | ask | show | jobs
by ora600 5526 days ago
My guess is that you didn't seriously learn functional programming in any language.

It is not just about memory management and data structures. It is about functions as first class objects, no side effects, lazy evaluation, closure, monads. The fact that you can basically write a compiler in an hour as a first year student (that was exercise 3 in my course).

I'm not a programmer, I'm a DBA. The code I write is mostly short and ugly scripts in Perl and Bash. I can do very little Java and almost no other language. The one and only time I used Lisp was in my first programming course in the university. Incidentally, it was also the one and only time I enjoyed programming.

1 comments

That would be a bad guess. For a start, Lisp is not a functional language. It just has some functional features. It has side effects.

I learned FP using Haskell, which is a pure functional language.

But I still stand by what I said. I code faster in Perl than I do in Haskell due to the availability of libraries. The "pure FP" features may make some things theoretically cleaner, but they don't honestly make things that much easier. Having access to FP features (map, grep, reduce, closures in particular) is significant, but access to built in data structures (hashes in particular) make life so much easier than C or C++ or Java.

I'm sure baudehlo knows, but some other readers may not: map, grep, and closures are all native in Perl 5, and reduce is easily available. (All are native in Perl 6.)
reduce is "included" - it's just in a loadable module in the core library.