Archive for February, 2010

Hello World in Scala ;-)

Today I made my first experiment with Scala. In my humble opinion this is the new general purpose language for the next 5 years! Don’t ask me why! It’s my observation from the read posts and the fact that most gurus make their little experiments with Scala in the last 5-6 months for example Uncle Bob’s company and Michael Nygard and now here is my first example.

>> HelloWorld.scala

package hello

object HelloWorld extends Application {

println(”Hello, World!”)

}

My experience with Eclipse 3.5.1 and Scala plugin 2.7.7 final was that  Scala plugin had some problems to create for me HelloWorld Scala Object. It didn’t allow me to edit the HelloWorld.scala file. At the moment I didn’t understand the meaning of object in Scala but I will find out soon. I think that Scala language plugin isn’t so well prepared for production purposes see the posts in http://stackoverflow.com/ . We will see the future of Scala and whether I am right with my prediction! ;-)

Tags: ,

No Comments

Rumbling : How to refactor existing code ?

Today I have  worked on my project in Java to make a refactoring of a class named TableUtil. First I decided to refactor it to Factory Method but I found out that TableUtil class depends on many small independent classes. These small classes are not so well implemented and I need of a new strategy for code refactoring. I realized that it’s very hard to refactor  a core class because it depends from many small and independent classes. These independent classes could be named leaves and the core class could be named the root of the tree. So if you imagine the picture it’s very easy to start tackling with the complexity from the leaves instead of the root. Briefly we need to work on small steps from the periphery of the complicated code to the center of the problem!

9 Comments