RSS

Monthly Archives: October 2011

#20 Don’t Document Deprecated Code

This should be obvious, but I worked with a team where several members thought it was important to document functions which were no longer considered part of the future of the product. Read the rest of this entry »

 
Leave a comment

Posted by on October 31, 2011 in Uncategorized

 

#19 Reduce Cognitive Load

Deeply nested IF statements can be hard for the brain to unwind and process correctly.  In many cases, the branch statements are selecting for a single, or a small set of conditions for which processing will be done, and outside of those conditions nothing will be done.  Given this, the code can be structured to avoid complexity, make it easier to understand, and less costly to maintain. Read the rest of this entry »

 
1 Comment

Posted by on October 29, 2011 in Coding

 

Tags: ,

#18 Don’t use TAB Characters

An age-old debate that should not exist.  Tabs are evil.  It is an attractive idea, but poorly implemented, non standardized, unpredictable handling, and so this post enumerates the ways that their cost far outweighs their benefits. Read the rest of this entry »

 
Leave a comment

Posted by on October 27, 2011 in Coding

 

Tags: , ,

#17 Program Logic Error

Not all exceptions are the same, and when writing a program, it is important to be mindful of whether the root cause of an exception is the programmer, or possibly environment or user data.  The latter type of exception can reasonably occur in a production environment, and so needs a translatable message.  But errors of the programmer can not happen in production, and thus should be handled differently. Read the rest of this entry »

 
1 Comment

Posted by on October 26, 2011 in Coding

 

Tags: ,

#16 Avoid Overloading Methods

One of the things that programmers learn with object oriented programming is that you can overload methods. That is, have the same method with differing parameters.  This can be convenient sometimes, but most of the time, it is an exceedingly bad idea. Read the rest of this entry »

 
Leave a comment

Posted by on October 25, 2011 in Coding

 

Tags:

#15 Branch Handling with Fixes

This is really a management issue, not a coding issue. In short: when a bug is fixed on a branch, it should be at the same time (or immediately after) fixed in the trunk. The logic should be obvious, but I found out recently that some development teams are NOT following this guideline.This post is an attempt to lay out the logic of why a software development team must follow this. Read the rest of this entry »

 
Leave a comment

Posted by on October 20, 2011 in practice

 

Tags:

#14 Never Catch and Continue

I ran across a body of code that is using a spectacularly evil coding pattern. This is not evil that presents itself as a devil with horns and pitchfork, but rather this is a wolf in sheep’s clothing. It is an evil pattern that looks so reasonable, and I bet most readers will look at it and initially ask “What is wrong with that?” Read the rest of this entry »

 
2 Comments

Posted by on October 18, 2011 in Coding

 

Tags: