Common new programming errors

In the course of the past year, I have seen quite a few good and bad habits pertaining to programming. One reason for the bad habits is sadly, some of the subpar entry level books that really don't have good programming practices. As a result, I figure that I should mention a few tips for an object oriented programming language that may make programs more readable and more beneficial.

1. Do not make methods bigger than your head. Seriously, a good method should really never exceed 15 lines of code unless it absolutely has to. If need be, split it into smaller methods to handle various aspects of the task if it is more beneficial. If this cannot be done, then refactor the program or possibly restart from scratch on the method.

2. Instead of reinventing the wheel for lesser tasks, look for open source source code that can perform the task in a simpler, more effective manner. An example of this is that for the Java language, instead of overriding the toString method manually, Apache Commons Lang provides a builder for this that can make life much easier.

3. After the program works and is finalized, document! There may be some parts that are not self explanatory and this will allow others to read the code in a much more effective manner. I've seen too many people who don't use any documentation and it drives me insane. When doing any type of team project, documentation can be the difference between success or failure sometimes.