Monthly Archives: November 2011

#24 Sprinkling "trim" through the code

One bad practice I have seen on many occasions is the use of trim() statements throughout the code.  This is a poor coding practice, and it is an indicator of disorganized code.

Posted in Coding | Tagged , , , | Leave a comment

#23 UTF-8 Encoding

Wondering what encoding to use for your web pages?  Wonder no longer.  Always use UTF-8 encoding.  It is the single best encoding, supports the most characters, the most languages, and is available on every browser.  That is all you need … Continue reading

Posted in Coding, practice | Tagged , , , | Leave a comment

#22 Avoid Multi-purpose Methods

This post is about the tendency to make a single method which does a lot of things depending upon the parameters sent in.  A method should not have multiple purposes, but should have a single purpose, and that purpose should … Continue reading

Posted in Coding | Tagged | Leave a comment

#21 Avoid Ternary Conditional Operator (? :)

There is a Java conditional operator, known as the ternary conditional operator, which is often used in entirely inappropriate situations that make poor code.  Abuse of this operator is so common that I advise avoiding it completely unless you know … Continue reading

Posted in Coding | Tagged , | 7 Comments