Good code is what
I write.
My standard of good is short, clean, efficient (usually a natural side effect of the first two) and commented well enough that you don't have to tie your mind in knots trying to figure out A) what it's supposed to be doing and B) how it's doing it.
Note that good code != good program. A program can be full of absolutely beautiful code and not do what the users want/need. Conversely, most of the systems I know of that have been truly popular are full of really ugly programming.
Djikstra wrote a short book on what was excellence and beauty in code. Can't remember the title offhand.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.