Friday, July 10, 2009

My Scala wonderings Lesson number 1, Classes and Objects.

So everybody are talking about scala. People say that this is the programming language of the future. My first encounter with it was about a year ago when the fuzz about it just started to be heard. Back then i gave it a try, but because a lack of time had not entered the language deep enough. So now i have some spare time in my life and i will be writing a series of blog posts about my experience with the scala lang.

Lesson number 1, Classes and Objects.

The first thing that i noticed was the lack of static concept in Scalas glossary. In Scala you have the Class concept which is the same as in Java and .NET and c++ and all other oo languages, and the concept of Object which is a Class definition as well as a single instance of this Class initialization. So Object is basically a singletone. This is Scalas substitution for the static notation. All static functionality in Scala will be declared as Object and hence be a singltone. I think that this is a great simplifying concept for a OO language, From now on you don't need to understand the static concepts and you just have Classes and Instances. Some of the classes have multiple instances and some have single... Simple enough..

0 comments:

Post a Comment