Posts Tagged ‘java’
More than two months ago I tweeted something like “As if this day didn’t already suck Maven 3 was released”. I got a reply from @kirean73 “Mind sharing your experiences with Maven?”. Fair question. As it takes more than 140 characters I decided to write a blog-post about it. And since I did not have time to do it there and then I asked @kirean73 to remind me after a month had passed. A month ago I got the reminder but this post turned out to be really hard to write. Mostly because there is nothing seriously wrong with Maven…
I’ve been looking forward to write this post for some time. I really don’t like Maven but I realized that I don’t exactly know why. It will be useful to explore that. I don’t want this to be just another of the many maven rants out there. I’ll try to be fair but I also reserve the right not to think that some things are good even if I can’t present a better alternative :) This is a subjective post.
I was whining recently about how my scala-code is java in poor disguise. I started reading the scala by example pdf that also comes with the scala installation. I just read some interesting things about lists and pattern-matching that gave me an idea how to “scalafy” the following scjava-code:
Most of my posts related to Scala so far have been quite long and unpolished I have intentionally kept them that way since I wanted to give a feel for what i is really like to make the shift, including the dead ends.
During the work of converting Java to Scala I have stumbled over some things that I found to be extra cool, nuggets. I’ll try to post them here from time to time.
The first nugget is about implicits. Implicits are so cool that I think I will shoot myself in the foot with them many times so let’s start now. One piece of java-code that I converted looked for module descriptions on the class-path. The code looked something like this:
Yesterday I started converting parts of my pet-project to Scala. Without any other ambition than to make the java-class compile in Scala, roughly 30 lines of java-code became 18 lines of Scala code! Most of the save could be attributed to constructor properties that removed the need for declared fields and assigning them in a constructor. I also managed to run my old test-suite with my new scala replacement together with the rest of the java-code in eclipse. Talk about seamless transition! Read the rest of this entry »
What do you do when you have all of these cool ideas for new projects and no time? How do you find the time to also keep yourself updated on the latest and greatest languages out there? Well, you would have to ask someone else because I don’t know. But I thought to give the nike way a try and just do it. I have a pet project called Agical publisher. I won’t bore you with the details of that project, maybe in some other post but what is relevant for this post is that I spend some time on it and it is written i Java.
Velocity is my favourite templating language so far due to it’s simplicity, general applicability and it’s clean cut between implementation and layout. It is dynamic so changes take place right away. And it’s fast.
I do have one complaint though and it is a trait velocity shares with a lot of templating languages: All decisions are made with if/else statements. This is fine in a lot of cases but there are times when it gets annoying.