Advices for less broken code?

The best coding starts with pencil and paper.