Alex Rivera | Logout

Functional programming applied

Asked 2009-07-22T20:58:02.167
11

I have been interested in programming all my life and for the past 6 years I have worked almost exclusively with Java. I just finished with my University studies and have a job as a Java developer for a company.

All these years programming has been a hobby and a favorite past time, but this had a slightly negative effect in the sense that i grew so accustomed to Java i never ventured beyond it as a programming language. I did try to expand my knowledge of things by learning regular expressions, SQL and studied a bit of XML but i could never get involved enough with a new language to learn how to use it properly party because they all look alike so much at their core, i found the learning curve of every new language irritating. I felt like i had to go through the whole process to end up right were i started as i felt that other imperative languages had nothing more to offer me (i know this statement can start a fight, it is not my intention).

I therefore decided at one point to explore the magical world of functional programming. I begun reading a book on Haskel and found it really interesting from an academic point of view (i majored in Mathematics) but could not find practical applications of it to get me going enough to learn the language.

So now that Java is the main part of my day since i am getting paid to code in it (and i enjoy it as much as i did when it was simply a hobby) i felt the need again to broaden my horizons and again functional programming seems like a good idea.

I thought i would start with Scala since i am Java literate (make the transition easier and be more reusable since they can "talk" to each other) and so my question is : In your experience does learning a functional language "make sense"? Are there any real life applications where knowing this paradigm may come in handy? Not only for personal entertainment but also would this be a "pro" in the industry?

Edit
Report

1 Answer

7

Learning a functional language is a big plus, regardless of whether or not you ever use it in your day job. Consider the following:

  1. One of the biggest recommendations for successful concurrent programming is to avoid mutable state in your threaded objects whenever possible. Functional programming teaches you how to do this.
  2. Most functional programmers, once they get over the not-insubstantial learning curve, claim that their techniques make them far more productive than they can be in standard imperative languages. Their code is more bug-free, and a fraction of the size as that of other languages. Think of the productivity boost you got when you finally understood regular expressions. Now put that on steroids. That's what FP can feel like.
  3. Functional techniques are rapidly making their way into imperative programming. Think closures in C#, and Javascript, and soon (maybe, if we're lucky) in Java. It's very likely the two worlds will soon come together.
  4. Finally, in job interviews, knowing a functional language will help you stand out from your average J2EE/.NET clone. It marks you as a self-starter, a disciplined learner, and a passionate programmer -- whether or not you actually are any of these things. Just don't become yet another slathering Scala fanboy, scolding your soon-to-be boss about how he's missing out on the best programming techniques since... you get the idea. It's never good to insult a prospective employer.

For me, studying Haskell has made programming a lot more fun than it used to be. It may do the same for you as well. Good luck!

answered 2009-07-23T00:41:24.293

Your Answer