What would be the best programming guideline/tip to follow to become a better programmer?
My favorite one is from the book The Pragmatic Programmer: From Journeyman to Master
Don't Live with Broken Windows
Their case is: One broken window, left unrepaired for any substantial length of time, instills in the inhabitants of the building a sense of abandonment. People start littering. Graffiti appears.
This theory inspired police department in New York and other cities to crack down on the small stuff in order to keep out the big stuff. It works: keeping on top of broken windows, graffiti, and other small infractions has reduced the serious crime level.
So, don't leave "broken windows" (bad design, wrong decisions, or poor code) unrepaired. Fix each one as soon as it is discovered. Neglect accelerates the software rot faster than any other factor.
Suggest your programming guidelines/tips.