Purple Haze!

We are on iteration 3 of the project and early on it was discovered that the Play framework was perhaps a little too “opinionated” in it’s ways. So much so that it dictates which version of Scala you use.

Scalatra

That wasn’t going to work out well for us so we decided to try Scalatra which is a very lightweight web framework. It’s influenced by Sinatra which is popular amongst Ruby coders. (so it must be cool huh?)

Here is a short example from the Scalatra Github

class ScalatraExample extends ScalatraServlet {
  get("/") {
    <h1>Hello, world!</h1>
  }
get("/hello/:name") {
  // Matches "GET /hello/foo" and "GET /hello/bar"
    <p>Hello, {params("name")}</p>
  }
}

Obviously it’s not best-practice to have your rendering code inside your controller classes so Scalatra has built in support for Scalate, which is a templating engine and let’s you choose between a few templating formats

Scalatra also seems to be pretty handy with testing and provides in-build support for ScalaTest

  test("simple get") {
    get("/path/to/something") {
      status should equal (200)
      body should include ("hi!")
    }
  }

The code above is pretty fricking sweet.

SBT

SBT is a Maven-esque way of setting up Scala projects. It’s still not as simple as setting up .NET projects (:p) but it’s not so bad. The configuration of the projects are written in Scala which is quite nice compared to Maven’s hideous XML files.

Getting started

A quick note that I have only tried this on *nix operating systems, Mac OS X and Fedora (what has become of me?). I’m not sure how easy or hard this is to do on Windows.

Install the latest version of Scala

Install G8

Navigate in a terminal to where you want to create a project.

g8 scalatra/scalatra-sbt
cd "name-of-app"
sbtupdate
jetty-run

Navigate to localhost:8080

If you then fire up your favourite IDE (I’m using Intellij) you will see that SBT and G8 have worked together to give you a basic project skeleton to play with.

10 May, 2011

Let’s play with Scala!

Posted by: Chris In: Random thoughts

Despite my previously quite negative post I am overall very excited about the project, if anything the reason for that post is my biggest concern is I wouldn’t get to work much on something so cool!

Today we decided some of the technology choices for the project, all of which I am delighted with

Play Web Framework

When I first knew we would start working with Java technologies, I decided to start learning what I suspect a hell of a lot of Java web developers do, Spring MVC.

It’s a tried and tested web framework and allows you to plugin whatever you like and do it however you like. However, the way I felt when I started was that it was just so overwhelming. It wasn’t immediately clear to a thicko like me how to just make a god damn website. Before even starting I was writing configuration in XML (yes I know this can apparently be mitigated) and playing around with dependencies. Argh! I just want to get going! I realise some of my readers will be cringing, just pointing out that my own ignorance is why I was struggling with it.

Well fuck that, the Play web framework is how it should be done. It embraces the web and just makes the whole process simple. Admittedly, I have only gone through the tutorial and I have not made even one large website with it, but it just feels right to me. One of the developers said it is similar to Ruby on Rails in that it does somewhat force you down a certain methodology and if you want to differ from that path, it may become awkward. But I love the way you can get a website running out of the box and the fact that to test your website all you have to do is save your code and refresh the browser, is pretty darn cool.

Scala

Finding out that I would be working with Java instead of C# for the project was a bit dissapointing. I know there are many debates about this but I really feel like Java is just a gimped version of C#. In terms of libraries it might be different but I know I would miss a lot of the functional programming elements which make me feel like a productive god when I was writing C#

The Thoughtworks guys suggested that because this was a new project we had a good opportunity to do something new and “cool”. Scala eventually may allow us to be more productive and will hopefully allow us to attract a better breed of developer.

We consider that we dont really want to attract a generic kind of developer who is happy to churn out Spring MVC java sites all day long, but someone who is interested in programming in different ways with different languages. Let’s hope it works out that way, as recruitment is actually a big problem for us right now, apparently there aren’t many talented Java developers who are interested in us :(

Despite all this enthusing about Scala, no-one on the team has actually done a large project in it. We’ve all had a play around with it and like it, but it remains to be seen how well it will go. I dont think inexperience will a problem, all decent programmers can learn new languages without many problems; it’s just whether it will be the best tool for the job.

I am absolutely stoked about getting to learn Scala on the job, so I cant wait for the inception stage of this project to be over so we can get stuck in.

04 May, 2011

It’s all change at Springer

Posted by: Chris In: Random thoughts

I have been with my current team for almost 4 years and I feel I have grown as an engineer in that time immensely. While I have been here the company has changed by merges and all sorts of going on. First we worked at Current Medicine Group (CMG) and then Springer Healthcare Communications (SHC).

Now I work for Springer IT (I think?). What has happened is the big boys at Springer (our parent company) wanted control over it’s online platform SpringerLink, which they currently outsource to another company; who cant respond to the company’s needs quick enough. So they decide to take us (the programming team) from Springer Healthcare and pair us with some clever consulting guys to create a superteam that will eventually deliver a brand new SpringerLink.

This project has immense importance. Silly amounts of money are being thrown at it as the site accounts for around 70% of Springer’s total revenue (I think). Springer is the one of the largest scientific publishers in the world, turning over 800 million euros in 2010 so you can appreciate this would be quite a feather in my cap.

The timing of this couldn’t have been better, to be quite frank I was getting disillusioned about the work I have been doing with SHC and was actually taking steps to leave. 90% of the time I was working with legacy code on terrible, trivial problems for seemingly pointless endeavours. I wasn’t feeling challenged and just seemed burdened with working on really boring projects. This is actually in contrast to what my experience with CMG and SHC has been in the past. I have been lucky enough to work on a number of interesting projects but in the past 6 months or so this seems to have all dried up.

So what’s the haps?

An interesting direction this project has taken is that we will no longer be working with the Microsoft stack will be taking a Java-esque direction. Exactly what frameworks and languages we will be working with are not entirely clear. I am hoping we get to do some Scala as I have played around with it in my free time and find it quite fun.

We have Thoughtworks helping us out with the project management, teaching us all how to be Agile. I was initially a little skeptical of it but once it has been explained it seems like a great way to work and certainly a lot more structured and professional compared to the way we normally work, which can be best described as winging it.

Anxiety

Despite the fact I get to work with a brand new project with new technologies to add to my CV, I have to admit I have a number of worries.

Snatching the development team from SHC was always going to have complications and the main one is that we have an obligation to give programming time to them when they need it. When I heard this I stressed how I really didn’t want to be laboured with too much of this burden because:

  • The reason I am still with this team is because of the new Springerlink, if it wasn’t for that I really doubt I would be there even at this point.
  • The more SHC work I do the less time I spend doing the “real” work and the more this happens the more it will affect my ability to have an impact on the project. I worry I will find myself being a poor Java developer because I wont be doing it as much as anyone else and I will be relegated to trivial problems and that would be just as bad as doing the SHC work. It’s going to be hard enough for me to have an effect on the project as it is, we will be hiring many talented Java developers whereas I have very little experience with the technology.

But what worries me the most is that I can really see this happening:

  • Since David has left I am by far the developer with the most experience in the SHC projects. Mike and Rob just dont work on SHC projects as much as me, for the past few years they have mostly been working with Springer. It is only natural that I will be the one working on these projects, despite the fact I hate it
  • Although there are assurances that I will get to work lots on the big project, it’s not like the needs of SHC are going to go away. This conflict of interest already happened this week and SHC “won” my time, easily. I just dont see how the work can be avoided.

So my main anxiety is that i feel I need to be involved with the big project as much as I can so I can grow into a Java developer as easily as possible and to be an important part of the project. However, I feel trapped into doing the SHC work.

From everyone’s point of view it makes sense for me to be doing SHC work.

Apart from me.

We will see how it goes.

Flickr PhotoStream

  • IMG_2069
  • IMG_2063
  • IMG_2060
  • IMG_2057

About

Hello, I am Chris James, I am a programmer based in London. I enjoy standards based web development, working in .NET with C#. This blog is mainly a diary for me but I occasionally will post about web development issues when the mood suits me.

My places on the internets