Exactly, I did all of the above. Spent too many hours fixing broken code (of my own) and finally I started to learn.
What about error handling? No mention here. What I do not is let the library/framework to handle most of it. With a recent server library I wrote, I can throw anywhere and it will be caught and displayed as expected without extra try/catch.