Synchronized code in distributed systems

I encountered some code recently where a GUI client was listening for Object updates from a multi-threaded server, and it was using the version number on the Object to determine whether the incoming Object was the latest version. The server incremented the version of the Object by inserting a new row into a table in [...]

Learn To Type!

If there was one piece of advice I could give to someone considering a career in software development it would be: Learn to f$%@cking type! Knowing how to touch type is the single most valuable skill that a developer can possess. Typing allows you to concentrate on what you’re coding rather than how to get [...]

Reflection HashCodeBuilder Performance

I recently embarked upon a performance investigation to figure out why a particular operation was slow. My theory was that it was the serialization/deserialization cost with a set of large objects; my colleague’s theory was the iteration over the set. We were both wrong. The investigation became intriguing when we started measuring the elapsed time [...]

A new assignment

My ex-project and I had been together for ten months. We had our fair share ups and downs, particularly in the early days, but over the last few months we had settled into a nice routine. It wasn’t particularly exciting any more but at least it was predictable. And then yesterday I was asked to [...]

How to insulate yourself from static methods

Sometimes your code needs to call a static method in a 3rd party library and unit testing  suddenly becomes difficult, particularly when that static method requires context in order to work. Enter the insulating class (also known as a Facade). Create a new interface that declares a method with the same signature as the static method [...]