How to write perfect code all the time

The most important thing a programmer needs to learn about is how not to make their lives a living nightmare.

This is bad:
Working extremely long hours on projects that fail because you’re always behind because you are always fixing bugs trying to meet impossible deadlines.