Programming

Switch your switch statements for something better

Posted on
fish in bowl

In the spirit of Dijkstra’s seminal work, let me dissect the bold statement given in the title, i.e. the switch statement. More often than not, I found switch statements in the code bases I work with to be a sub-optimal solution, and as usual, this is nothing new. Robert Martin already wrote about the detriments […]

Programming

Applied Mathematics: DRY up your code

Posted on

Recently, I had a few¬†discussions about the usage of mathematics in programming. Unfortunately, a lot of computer science students believe that the mathematics they learned for their degree is not applicable to their every day work as software developers. Let me give you a glimpse into “applied” mathematics in every day programming with this post. […]

Programming

Deprecating the Observer pattern

Posted on
Design Patterns Book

Pretty much every developer these days knows about the above book: Design Patterns, by the famous gang of four. Within the book, we find a lot of valuable information including the observer pattern. In this post, I will give a quick review of this pattern, show how it’s directly supported in Java, and why you […]

Programming

On the harm of simple types

Posted on

Recently, I encountered a lot of occurrences, where I found problematic code that was essentially caused by the usage of primitive types where they simply were the wrong tool for the job. The following article will hopefully make you stop and rethink what you’re doing when you’re using one of these types the next time. […]