views:

497

answers:

6

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?

+1  A: 

Please, check out this related question.

http://stackoverflow.com/questions/821105/functional-languages-erlang-f-haskell-scala

I hope it helps.

Tiger.

Tiger
+1  A: 

Learning a functional language definitely makes sense. As Eric Raymond says, if you learn a functional language, it will make you a better programmer in the language of your choice.

From an industry perspective, if you can write good code in a functional language such as Haskell or Objective Caml, you will suddenly be in very high demand for a very small number of positions. It's not clear whether any sensible person would consider this a 'pro', but there are certainly a few very interesting companies that have openings that are for functional programmers only.

Norman Ramsey
+7  A: 

In my opinion learning functional programming it is not only a good idea because it makes you a better programmer (think which I agree, of course) but because it seems it will become very popular in a near future.

A lot "gurus" are saying that it will be the only way to keep Moore's law alive. Computer clock speed has reach a top and the only way to improve processors speed will be adding more and more cores. In this scenario functional programing becomes handy because in those languages data is immutable and that makes them very easy to paralelize (it can be done automatically actually).

You might want to have a look to the next references

Buff, I hope it wasn't too bored, ;-)

fco.javier.sanz
An intriguing idea, thanks.
Liran Orevi
+1  A: 

Yes, it makes perfect sense, and is immediately useful in some common tasks you might encounter in production (even if you write them in Java). For example, if you will ever need to write a parser (for a DSL, for example), you'll find that using functional techniques to do so leads to much cleaner and more concise code.

Pavel Minaev
+5  A: 

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!

rtperson
+1  A: 

Functional programming has been making inroads in the financial sector. Which isn't really all that much surprising, if you consider financial analysts have been "programming" in Excel for years, and that's essentially a functional paradigm (more precisely, functional reactive).

So, yes, knowing functional programming can open a few doors just OO can't, and such jobs can be very interesting.

Speaking strictly as a Java programmer, you'll learn techniques you can employ in Java in your day-to-day (though you'll want a better Collections library). Techniques which will decrease the amount of bugs in what you code, make it easier to multithread and multitask, and bring your code closer to the business rules it is implementing than the mechanics of it's implementation.

Now, there are other reasons to learn Scala in particular. Those above, though, are my reasons you may want to learn functional programming.

Daniel