Somewhere in the last few months, I decided to learn Scala. And master it. There are several reasons to do this, but a couple of them is enough for me:
- The desire to learn something new, different. Java is nice, I love it. But I want to learn new ways to do things; I want to open my mind to new ideas and possibilities;
- The urge to be more productive, to be able to spend more time on what matters, and less on boilerplate code. Ruby on Rails is one big inspiration here, but I want something more focused on the Java platform.
So, after discovering about the existence of Scala through one of the Java Posse episodes, this was the language I decided is going to be my next big step in terms of software development.
I still have a LOT to learn. I am just a baby when it comes to Scala. But a few things already hit me. One of those is that Scala source code may seem alien at first. For example, instead of declaring variables like this:
Integer count = 10;
you would do this:
val count: Int = 10
There are a few interesting things about this code:
- semi-colons are optional;
- the type definition comes after the variable name, instead of before;
- the type definition is optional in this case: you know 10 is an integer, right? The Scala compiler knows that as well.
I’ll be posting more about Scala as my learning progresses, so stay tuned! Any expectations? Leave a comment!
