Sunday, December 4, 2011

You should go to Scala school!

If you haven't already, you really should check out Twitter's Scala School.

Of course you know that Twitter, LinkedIn! and FourSquare all love Scala. But Twitter in an flash of admittedly enlightened self interest, created the Scala School web site to help their own employees and potential employees quickly and easily learn Scala. 

One of the claims floating around the Internet is that Scala is hard to learn. Having spent about a year and half hacking around with Scala at this point I have to admit that there are aspects to the syntax that can be daunting at first. But the Scala School from Twitter provides a great example of how easy it can be to pick up the core of Scala and even do it with a functional programming approach early in the process. 

So, what are you waiting for, check it out

hackqd -- 4 Quick and Dirty Hacking

This last week at work I ran into a problem where I needed to analyze some log files. Being a linux weenie I started off by firing up the shell and started grepping and bashing my way around the problem, all the while thinking... "sheeshz, I sure wish I could do this in Scala". 

After a bit of brief googling I ran across Tom Morris' great article about "hacking" with Scala, http://tommorris.org/wiki/Scala_for_Hackers  As you'll see if you read it, by "hacking" we're talking about the sort of thing that developers and system administrators do constantly, i.e. writing "as simple as possible" utilities to help them take something apart or put something together. And if you're in the business of building cloud based systems you know exactly what I mean there's lots of this sort of utility work that needs to be done.

However, when I set off to use Scala for this I quickly discovered that reading Tom's article was not enough. First off, I wanted to work with 2.9.1, the most recent Scala compiler. Next up, I wanted to use com.googlecode.charts4j which immediately adds dependency management etc. And of course... I just wanted something simple to run from the command line. 

In case you didn't realize it, sbt has a great solution for exactly these sorts of problems. The "console" command allows you to use the Scala REPL from the command line and include all the dependencies in your project. But setting this up and figuring out how to get something like an App like trait capability accessible from sbt's console mode took just more than the couple of minutes I had available at work. 

So... I decided to hack at it over the weekend. 

The result is posted on github at https://github.com/langley/hackqd I hope to continue to refine this and add notes and a github wiki page to explain some of the experiments and continue to provide a good starting point for people who want to:
  • hack up a scala based solution to something
  • use charts4j and other useful hacking libraries from scala
  • and who knows what else... 

Having nice "bite sized chunks of code" usable as a starting point for building out quick Scala based hacked solution seems a great tool for learning getting started with Scala. 

-- Langley

Raison d'ĂȘtre

This space is for capturing brief snippets from the world of Scala programming...

I often run across fascinating links, articles and projects in my wanderings and would love to share them with a larger community of interested developers. The natural goal being to spread the word about the great work going on in the Scala development community and to share some of my own experiences as I climb the learning curve of what I think is a GREAT new programming ecosystem.