Stefan Priebsch’s Anti-patterns talk followed Josh in the main auditorium and his style for me was a welcome contrast. He said he wasn’t going to be funny, but any self-deprecating German is going to find easy chuckles in front of a largely English crowd.

There was a rather amusing moment towards the end of his talk as Marcus Baker tried to hurry him along. The irony of an Englishman prompting a German on timekeeping was delicious.

The subject material is probably fuel for another blog, but I think Stefan’s talk highlighted the fundamental problem I have with Anti-patterns. If a design pattern is a generally held ‘good way’ to solve a common problem, an anti-pattern must then be a generally considered ‘bad way’ to solve a common problem.

The issue is twofold. One, not everyone agrees on what constitutes an Anti-pattern – i.e. what is bad. And two, if an Anti-pattern is a common (albeit bad) solution to a common problem, there must be a ‘good’ alternative right? Well, that’s the thing, the answer is not always a clear yes.

We are regularly cautioned on the evil of Singletons, or of the pitfalls of Globalitis. Rarely though, are we shown a ‘good-way’ to avoid these patterns and solve our problem easily. If we go back to the late 90s, early 00s, bearded boffins at Sun Microsystems gave us things like RMI and Enterprise Javabeans. These technologies employed what were considered good practices, but were too cumbersome to actually use in the real world. It’s very easy to say xxx is real bad. It’s a lot harder to say how to do it better without significantly more effort.

Stefan’s talk fell a little bit in to this trap. He showed us serious cases of Globalitis, but failed, I think, to argue convincingly why class constants, for example, were such an awful, abominable thing. We heard again about the evils of Singletons.  But Singletons have their place and used sparingly can be a powerful solution to application design problems.

All this said, Anti-patterns are a fun subject. They have much cooler names than regular design patterns. Give me the ‘Magic Hammer’ over a ‘Table Data Gateway’ anyday.  So in summary, I enjoyed Stefan’s presentation and it was one of the most thought provoking of the day. I found he covered a fair bit of ground, introduced enough vocabulary for the uninitiated and enough detail for everyone else. The tone and pitch seemed appropriate for the audience too.