Tag Archives: coding guidelines

More Good Coding Practices

Don’t introduce ordering where not necessary. Be advised of more subtleties here than are visible at first glance. Consider enumerations; an enumeration value has a name and a code. The code is redundant and is probably there for optimization purposes; as such, you should not work with it. The code associated with a value is [...]

Annotations and Attributes Are Evil

Relax, relax, they aren’t evil. They’re just misused, their misuse is easily promoted, and it can even come across as appealing. Spring enables AOP through annotations, Hibernate understands metadata specified as annotations, .NET’s XML serializer allows inline attributes to specify how to serialize an object’s properties, a certain JSON library does about the same thing [...]

Add, Remove and Mature Interfaces

So should you really pair up Add* methods with Remove* counterparts? I just had a wild vision about this. We were strolling on the side of a beautiful countryside road, autumn leaves falling around us, birds chirping. I’m sorry, that was something else. It just so happens that I’m working on a certain mapper involving [...]

Setting Those Column Lengths

In which I pick on the X in VARCHAR(X)… We’re all good at putting up a table in a relational database. We’re even better at guessing hard limits for the VARCHAR columns. But is it really such a good idea to put all those hard limits? I think software written for the future should not make assumptions [...]

Good Coding Practices

Reduce Asymmetries I recently created an incremental update collection of classes which featured some version-aware processing. Let there be an application having a given version, a resource also having a version, and a collection of updates which can transition resources from a start version to an end version. The problem at hand is to come [...]