Programming

Deprecating the Decorator pattern

Posted on
Design Patterns Book

This post explains how modern languages make most usages of the decorator design pattern obsolete. For those of you, who do not know the decorator pattern, a quick recap is given, before I explain why it’s not really a good idea if your language supports multiple inheritance properly. Finally, we will look at those few […]

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 […]