Recently I encountered a blog entry describing a “beautiful” way of making the code more readable by creating a gereric helper method to perform object casting. Today I want to share some opinions about this improvement and general thoughts about coding.
The premise
In essence author of this post was trying to solve following problem: imagine you [...]
Beautiful casting gone bad
How to write a Singleton (3/5)
In two previous posts I have tried to convince you not to implement the Singleton at all and to give up implementing it with lazy initialisation. Today I show how to write a singleton that uses lazy initialization. The presented code is one of 3 possible versions – the most readable one. Others will be [...]
How to write a Singleton? (2/5)
In one of the recent posts I was trying to convince everyone not to create singletons. For those who still are not convinced I show today how to write it in a simplest and safest way possible. The following code base on one assumption: you do not need lazy initialization.
The idea behind lazy [...]