Everyone always wants to say worthy things about the qualities that make a good programmer. But I occasionally think that "a sense of humour" isn't given enough credit.
In programming, you're constantly making mistakes, and being told you're wrong (by code reviewers, bug reporters, and the computer itself). If you let that get you down, you'll quickly find another career.
When I realise I've made a mistake, my reaction is often to find it amusing – smile a bit, maybe laugh out loud, share it with a friend if it's funny enough.
I can't remember how I got that attitude in the first place. Perhaps just luck. But I sometimes think it's the main reason I stuck with what would otherwise be a frustrating profession!
@fedward @simontatham I have a friend and former coworker who is currently maintaining a stack of bioinformatics/sequence analysis stuff originally developed by ...let's be kind and say, "non-coders", that I completely rewrote during a period of pretty high stress, and he periodically toots out comments that I left behind. It's amusing.
(As a sample, the first line of the project's README.md was "Lasciate ogne speranza, voi ch'intrate"...)
@genehack @fedward I suspect that's a fairly common opening line of terrifying comments, along with variations on 'here be dragons'!
One of my favourite comments I ever wrote occurred when I found an incomprehensible source file, spent an afternoon making sense of it, and since there wasn't an explanation already, wrote up what I'd found in a big comment at the top, with the opening paragraph
"This module is totally incomprehensible without hours of drawing small diagrams and swearing, so I'm going to write a comment for the benefit of the next poor sucker."
The reason I liked this so much was that, ten years later, it turned out that the next poor sucker was Future Me, who was very grateful to Past Me!