Early experiences with serious Scala code

A few quick notes on my first experiences writing serious Scala code.

I had heard the IDE plug-ins had some bugs.  For me, understatement of the year!  The Eclipse plugin would not even let me paste in text, frequently would not let me insert text into source code with syntax errors in it – had to give up pretty quick.  The Netbeans plugin was better, but still gave up in it too pretty quickly. Back to vi!  (I keep hearing the new Scala 2.8 Eclipse plugin being developed will be a lot better – but no ETA on its release yet.)

Like all languages, you have to know the syntax.

  • I found the use of => very confusing at first.  It seemed to be used in several contexts, so fragments like Int => Int => Int were just plain confusing.  Its still a bit confusing at times, but after a while it starts to sink in.
  • I found –> also a bit confusing until I discovered its just for creating a tuple with two values in it.  (Tuples are like anonymous C structs.)  Its useful with Maps for key/value pairs.
  • The compiler errors are not very helpful at times.  This may be because the language grammar is so small and flexible, its hard for the compiler to really know what went wrong.
  • I think Array[Int] maps to int[] (and not Integer[]), but could not find it clearly stated anywhere.
  • Understanding all the libraries seems key.

 

But the more code I write, the less frighting it all is.  Its starting to just feel like another programming language.

I must say the first Actor code experiences are fairly positive.

But for all I have been hearing about Scala, I was really surprised to see how poor the tools support was.  This would probably be the main reason to give me pause to use it on serious work.  The Actor model for concurrency glued on top of existing Java libraries would be my main reason to consider using it.

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: