After nearly 20 years doing this programming game professionally, in the last 10 years or so, I've been in the habit of writing an automated test suite right along with whatever code I'm writing.
If that test suite and the new code I've written work first time, I'm immediately freaked out and stare at the code suspiciously a few times before believing I wrote both the code and the test suite correctly. Usually I then frob the code so it's wrong, run the test suite to make sure, then frob it back.
That freakout probably tells you how rare it is to get code right first time. :-)
As far as silly things done goes... This morning's was wondering why work people haven't got my email telling them I'm working from home today when it's sitting there right in my outbox because I haven't turned on the secure tunnel to the work email server...
Tests passed first time = Freakout
If that test suite and the new code I've written work first time, I'm immediately freaked out and stare at the code suspiciously a few times before believing I wrote both the code and the test suite correctly. Usually I then frob the code so it's wrong, run the test suite to make sure, then frob it back.
That freakout probably tells you how rare it is to get code right first time. :-)
As far as silly things done goes... This morning's was wondering why work people haven't got my email telling them I'm working from home today when it's sitting there right in my outbox because I haven't turned on the secure tunnel to the work email server...