Everyone writing web applications at some point has a run in with JavaScript. Frankly, it’s ugly, it’s dynamically typed and not really object orientated.
I’m one of the old school who likes statically type variables (at least by default anyway).
Recently I’ve adopted using TypeScript, an open source language from Microsoft for putting manners on larger scale JavaScript projects. TypeScript is a superset of JavaScript (For the more nerdy, ECMAScript 6 is their target). As a result, it runs with just about anything that runs JavaScript, even node.js. When combined with good IDE integration it’s a really good experience.
A while back I had to construct a technology demonstrator relying heavily on JavaScript, that amounted to a single page application. I got it finished to my satisfaction, but I was never really happy with the JavaScript. My “objects” were rudimentary, my functions ugly and it had too many code smells. I wish I’d known about TypeScript. My most recent project is heavily dependent on JavaScript and with the use of TypeScript a much cleaner prospect. I’m using interfaces, small classes and most importantly inferred static typing (awesome!). When I save it’s automatically compiled to plain old JavaScript.

The code above doesn’t duplicate the type parameters unnecessarily as it made perfect sense to extend type inference to instantiation. Now Java 8 pushes type inference a little further. Read the rest of this entry »

Just like many of you, we’ve been developing RESTful services for a while. We’ve used various frameworks in .NET and in Java, in large systems as well as on the server-side of our mobile apps. Unless there’s a good reason not to do so, REST is our preferred approach in building a service layer. Recently we’ve had a series of discussions about different approaches in building a RESTful service layer and I decided to outline one of the ways to do it using RESTEasy, Jackson, JSON and Spring Framework on the Java platform.