points by 1718627440 4 days ago | 0 comments
I had the same experience of writing almost no bugs when writing on paper. (Only conceptual bugs, e.g. in architecture or that I solve the wrong problem in the first place.) But when I now write code on a computer, I do introduce bugs. However I regularly find tricky and rare to occur race conditions or heisenbugs just by printing and reading the code from top to bottom, without a goal, just for entertainment. I did not know of the existence of the bug, before I find them. They stick out when you read it, because it's not what you have in your head that should be written there.
It helps me to print it in a different font/color and without syntax highlighting to force my brain to read it as new code, instead of simply assuming it's the same as I already know.
i never use syntax highlighting. one day someone told me it was very distracting, i turned it off and suddenly things were calm. Maybe its just taste but i do find it helpful. you really read stuff rather than assuming some color happening means its correct or incorrect subconsciously