Something else then Margaritas with Tequila

Tomas Malmsten
20 February 2011

Last night we had our neighbour over for a couple of cocktails. The spirit for the evening was Tequila. A bottle of Jose Cuervo Especial Reposado to be more specific.

My favourite for the evening was Amante Picante. It's a wonderfully refreshing drink made with cucumber, coriander, hot sauce and agave syrup. Most recipes uses green Tabasco but I much prefer using Cholula Original hot sauce, if you can get your hands on it. The recipe is:

Continue reading →

How to create a factory for strategies without using if’s

Tomas Malmsten
24 January 2011

A recent discussion thread on the Design Patterns LinkedIn group got me thinking that a blog on how to create a factory for strategies in Java would be useful. The method below removes the need for if or switch statements.

I will start with the code and then go on to look at the details.

Continue reading →

Tequila old-fashioned

Tomas Malmsten
4 November 2010

I have been contemplating writing about cocktails for a while now. It is after all one of the things I'm most passionate about. To kick this subject and section of I would like to write about an old-fashioned cocktail introduced to me at Ruby in Copenhagen. The Tequila old-fashioned.

It is pretty simple to make. Take an old-fashioned glass and fill with a large chunk of ice. I prefer using a single block that just fits into the glass then using ice cubes. Add two spoons of agave syrup and two to three dashes of orange bitter. Pour two shots of good quality tequila and stir thoroughly.

Continue reading →

Clean Code – Functions

Tomas Malmsten
3 February 2009

In August 2008 Robert C Martin released a new book, Clean Code. It's a well written practical book about how to write readable easy to maintain code. Since starting to read it I have also brought the concepts up during the code reviews we run every Friday.

Last Friday we discussed a compareTo method I had been working on during the morning. The aim was to turn a fairly simple but not that readable algorithm into a highly readable chain of functions. We used a few rules discussed in Clean Codes chapter about functions:

Continue reading →