Category: technology

  • Expressive or just terse?

    This Scala code populates a list with objects: So does this. If you’re a Java programmer and just balked, you’re probably not alone. I know what it does and I have to read it from left to right to left to right again. In this case the shortcut’s a Scala mental snag equivalent to Java…

  • NoSuchMethodException launching Scala App

    This is a pretty standard thing to do in Java: So you reckon you’d be able to do this in Scala: You go to run it and: Exception in thread “main” java.lang.NoSuchMethodException: id.jakubkorab.App.main([Ljava.lang.String;) at java.lang.Class.getMethod(Class.java:1605) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:107) Turns out the Scala compiler doesn’t treat application launching in the same way that it treats other classes…

  • Running a Scala App in IDEA 9

    My first experience with IDEA hasn’t been a good one. In all fairness, not IDEA itself, but with a plugin (isn’t that always the way). I use Eclipse on a day to day basis, but since I heard that the IDEA Scala support is much better, I decided to download the Community Edition and give…

  • Get Functional

    That was the message that was coming through the Devoxx conference presentations this year. The idea that it will help your code run in the brave new world of multi everything (multi-core, multi-thread etc.) is one that’s widely touted, but rarely the primary driver for its use. Instead, it’s about less code, that’s more easily…

  • Deep Diff Pizza

    There is nothing I love more than a proprietary, undocumented API. Call it an unfortunate fact of life, but weird object models that hang together by the skin of their teeth are out there. Most of the time there’s no validation logic to check that they’re semantically or syntatically correct until you send this tangle…

  • A Better Builder

    The builder pattern should be familiar to anyone who has needed to change data from one format to another. Often called assemblers, translators or similar, they’re found peppered throughout almost every project. The idea is pretty simple: It’s OK for translating small object graphs, but for non-trivial work, these things can turn into huge heaving…

  • Testing the Untestable

    Once upon a time you got sick of writing code and having it fail when you ran, or someone else did, and you learned to unit test your code. You read the JUnit docs, and wrote tests for those classes which contained discrete, self-contained code. And quickly realised that the world doesn’t work like that.…

  • A Peek Under Intentional’s Skirt

    The guys from Intentional Software did a presentation on their Domain Workbench at the DSL DevCon which is now available at the Oslo Developer Center. The company was started by Charles Simoyi (of MS Word and multiple space trips fame), who has used the squillions he made from his work at Microsoft to try to…

  • The Church of the One True Language

    I stumbled upon an interview from JAOO 2007 with Joe Armstrong and Mads Torgensen discussing Erlang, concurrency and program structure (objects versus interrelated processes). It was really interesting to see how similar yet different their points of view were. I’m not going to paraphrase, as it’s worth listening in on it. Two points came out…

  • Groovy properties

    I’m on a Groovy buzz at the moment. I figured that I’d learn the language properly rather than poking around, doing stuff in Grails. It’s one of Groovy’s huge advantages that you can hack away as a Java programmer and be fairly productive. So playing with properties: class Thingo {   def value   def…