News for hackers. Stuff that matters.
Re:It's Time to Get Good at Functional Programming by breck on Sunday December 07, 2008 @06:20PM (#389239)
Can someone explain the top 1, 2 or 3 benefits of FP? I just want to hear the key positives that would make an order of magnitude benefit to me. If FP would increase my productivity 5%, not really interested. If it's 50%, that's something.

For instance, I would say for OO two benefits that can create an order of magnitude increase in a programmer's performance are: - much easier to use 3rd party libraries(since most good code is OO) - much easier to modify/debug code

Re:It's Time to Get Good at Functional Programming by kriyative on Sunday December 07, 2008 @06:55PM (#389283)
Top 3 benefits (IMHO):

1. Concurrency done right -- take a look at Erlang or Clojure to get an idea of multi-threaded programming without the nightmare of locks and deadlocks. This feature will become increasingly important as CPUs are scaled by integrating more and more cores.

2. Testability -- immutable variable bindings and carefully sequestered state changes means your code is vastly better suited for testability.

3. Distributed Computing -- this maybe a controversial claim, but in my experience building distributed systems in Java, Common Lisp and finally Erlang (on separate projects of course), Erlang stood out as the most robust and understandable distributed model of all.

In so far as 3rd party libraries go, a lot of newer FP languages are built on top of existing VM platforms (e.g, Clojure on JVM, F# on .NET), and are able to leverage all their available libraries. Bear in mind, that while these libraries may help build your application slightly more quickly, you end up sacrificing the benefits of FP by integrating their non-FP code.

Check out http://www.defmacro.org/ramblings/fp.html for a much better overview of FP (don't miss the "Benefits" section about a third of the way in).

Re:It's Time to Get Good at Functional Programming by breck on Sunday December 07, 2008 @07:13PM (#389291)
thanks! really helpful