I think the diary analogy is great, but the author fails to explore it properly. It ignores aspects such as self-awareness, self-consciousness and self-censorship. Notice a lot of 'self's in the previous sentence? A diary is a very personal thing. When you are writing in your diary you poor your heart out about everything and anything. You can do this because you are the only person who will ever read this stuff. Imagine writing something that other people will read, like your mom (anything sex-related is out of the question), your colleagues (better not say your boss is a total jerk), your friends (don't mention that secret Anne told you about Peter, or you wlll lose 2 friends) or your government (no wait, they already know everything anyway).
Similar things happen when you are writing code for yourself and yourself only. When I write code for my own pleasure. I don't care so much about documentation, clarity, robustness, polish, etc. Yes, I am a bad, bad person. Anyway, compare writing code for yourself with code you share with friends (generally supportive, but add some polish and fix that hack so they don't think you're a complete idiot), colleagues (semi-critical yet supportive, maybe try to score some bonus points using a FactorySingletonVisitorBean) or hackerne.ws (super-critical, probably rewrite it in the language-du-jour first, prepare to be burned at the stake anyway).
Similar things happen when you are writing code for yourself and yourself only. When I write code for my own pleasure. I don't care so much about documentation, clarity, robustness, polish, etc. Yes, I am a bad, bad person. Anyway, compare writing code for yourself with code you share with friends (generally supportive, but add some polish and fix that hack so they don't think you're a complete idiot), colleagues (semi-critical yet supportive, maybe try to score some bonus points using a FactorySingletonVisitorBean) or hackerne.ws (super-critical, probably rewrite it in the language-du-jour first, prepare to be burned at the stake anyway).