Thursday, January 7, 2010

Why I started learning Scala ?

Recently I started learning Scala language.I have been working on java for the past 4 years and is quite satisfied with it.I am also sure java is going to stay there for a long term against all the criticisms and hatred of those dynamic language advocates. Java gives me lot of confidence to take a problem or project as I am sure there will be a solution in java for everything. As a new comer it may be confusing as java gives you a lot of options and it is difficult to choose the right approach or solution ,but as you mature you enjoy the freedom and power it gives .It is especially because java's open source nature and availability of lot of open source libraries and frameworks. Look for example how many web frameworks you have in java.

Recently we saw emergence a lot of jvm languages which according to me strengthens the java language platform. The important among them are Jruby,Jython,Scala,Clojure and Groovy Jruby and Jython are JVM versions of Ruby and Python respectively ,which are two powerful dynamic languages. They helps lovers of those dynamic languages to stick to that platform and at the same time leverage the power of JVM,the most tested, trustworthy VM platform. Groovy ,Scala and Clojure are developed independantly and among them scala attracted me very much and I decided to learn scala .This is mainly because I felt any need of learning any of the dynamic languages in JVM as java gives me what I want and I am confident with that. But when looking at Scala I saw some interesting stuff and felt it is worth to learn that. I am listing down some of those features.

1) Functional programming
Scala support for functional programming attracted me .As of now I didn't think much about the style of programming I followed and the debate over Imperative or functional programming in scala groups pushed me to take a deep look at functional programming aspects. Scala being a multi-paradigm language leverage the power of both functional and imperative approaches.
2) Type inference
Scala is strongly typed language and at the same time it has something called type inference by which it infers the type of a variable and relieves most of the burden from programmer.
3) Actors
Actor is a more advanced way for parallel programming instead of using threads and locks which is very low level and difficult to use for programmers.
4) DSL support
DSL (Domain specific languages) are gaining popularity and scala offers a power full support with its parser library.

I will try publish detailed notes on each of these as I progress ,but the interesting point is
that it forced me two look deep at some basic concepts of programming which I consider very valuable as a programmer.

No comments:

Post a Comment