Skip to content

IIIrd attempt at Scala

December 1, 2013

Inspired by :

So, rather than doing a helloworld and TOC study, I will try to understand why is it getting so much attention from the programming world. I will see the forums and communities to understand how it feels like working with scala.

*one line expression can give you results. (Verbosity) but isn’t that going to increase complexity?
*everything is expressions and not statements.
*every value is an object and every operation is a method call (No Primitives) but what about reference passing and memory blot?
*Functions as first class objects. Thereby, It is possible to pass functions as arguments, to store them in variables, and to return them from other functions.
*pass functions around as they are full time members of the language now(Higher order functions) but do we need them anyways?

OK… Scala is not just a functional language but a hybrid.

Concurrency and parallelism : more interesting here.

Going further now:
No static here for methods or fields. Use object to create singleton directly.
Imports are a little different. *{asterisk} is valid scala identifier so use _{underscore} . It can also import static members directly.
Methods taking one argument can be used with an infix syntax.
Functions can be anonymous like classes in java. Functions without name .. ding !
Method overriding from a super-class is ok. It is however mandatory to explicitly specify that a method overrides another one using the override modifier, in order to avoid accidental overriding. Compile time error.


From → Scala, Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: