For Java developers who have heard about Scala but, although it might sound interesting, are getting on with what they need to do in Java thankyouverymuch.
What I do with the Scala IDE for Eclipse when working with Maven projects.
or: a visual interpretation of some of the syntax of the Scala programming language, with the aim of providing an aide memoire.
: =>
(Yeah, I needed to include the : to make this work).
“The walrus prefers shallow shelf regions and forages on the sea bottom.” And like the walrus, in Scala the symbol for by name parameters allows the shallow surface parameter to forage deep inside your code.
The other night I sat down to satisfy just one more quick-fix screen-scraping twitter-based itch. Of course I decided to scratch using Scala, and it really is an attractive language for “doing stuff”. It also made me reflect on how Scala has already started to changed the way I write software.
Here’s the itch: If you live in the centre of the pebble-beach city of Brighton, and have a dog, the tide times become really interesting, because at low tide sand is revealed, and sand is fantastic to play fetch in. You can get Brighton tide times from VisitBrighton.com, but of course I want the information at the point I’m going to use it. And for me, that means I want a tweet at 6:30 every morning. And so, @brightontide was born (I’m still chatting about copyright with the council, so it might have to disappear).
I know next to nothing about the Wicket web framework, but I was intrigued by the jWeekend London Wicket User’s Group meet up last night. The topic was “Scala and Wicket”.
As far as Scala and web frameworks go, the main name is Lift. The problem with Lift… No, let me re-phrase that because it’s not a problem with Lift. The great thing about Lift is that it’s made for Scala, so it’s going a great fit to the language. Learning Lift and Scala at the same time should mean you’re bouncing the framework learning and the language learning off each other, which is going to teach you a lot.
In addition to the completed and shipping Programming in Scala book from Artima, there are three others in the works:
Great news.
If I’m going to be picky, I’d say I’m a little concerned all these look like they are language books, rather than “activity books”. What I mean by that is there’s no “Database Persistence using Scala” or “Building Fast Web Sites Quickly with Scala” or “Asynchronous Messaging with Scala”… you get the idea. Sure, you can just get on and use the Java way, but the idiomatic Scala approach is what I’m looking for.
Now that I have a physical copy of Programming in Scala next to me, the final excuse for me not spending more time with the language has gone. In the interest of dipping my toe in the language (well, it’s more like my whole leg by now) I’m making a conscious effort to do all and any scripty things I have to do in Scala.
One such script-like thing is the ‘Hull City problem’. It’s actually a very simple problem, and now I think about it, it’s more an assertion than a problem: Hull City football club is the only club name in the English league that cannot be coloured in.
There’s something right about £5 App running a demo/game/fun event as the Xmas special. I mean, how does this sound: I turn up at The Werks, icy cold, to be handed a lovely hot mulled wine by the Ribots, directed towards the mince pies, and then entertained with a range of funky technology stuff. Mmm.
This evening there were talks and demos covering: collaborative interactive fiction (a.k.a., group-generated text adventure), namely Spaceship; Emily demoing robot sumo; mobile phone Lightsaber dueling (no, not with the iPhone); eye controlled Pong, from Ben Rubinstein. All excellent.
Last night was the Brighton Scala User Group pub meet up (Wayback link to meet up). For the record the conversation covered:
The next event (Wayback link to next event) will be 17 December 2008.
This year the London Future of Web Apps conference was held at the ExCel centre. Ah, the ExCel: a place that feels both sterile and grimy—something I thought only possible at airports and large shopping centres.
The conference? It lacked substance, and was disappointing in that respect. Still, that’s not what it’s all about: it’s good to just take some time away from the keyboard, and talk to people about “stuff”.
I did enjoy…
One of the projects we’ve been working on involves kicking off a number of threads to check on availability of certain services. Despite having read the fantastic Java Concurrency in Practice book (which you should buy, possibly from Amazon UK) we’d run into a situation where Tomcat wasn’t shutting down. Inevitably it’d be because we’d starting a thread that wasn’t stopping. As a reminder to myself here are a bunch of useful tools for figuring out what might be going on….
I have a love/hate relationship with Groovy. I do find it wonderfully productive for hammering out a quick script to do something, but I feel uneasy attempting anything larger without my crutches of static analysis (strict shouty compilers and Find Bugs) and knowing there are great profilers if I need them. Yet, when returning to Java I’m left thinking “why do I have to write so much code?”.
You’ll understand, then, why I find Scala so appealing.