in reply to
What habits do you have to avoid introducing bugs?
Bearing in mind that every line of code can contain errrors, I try to write as little code as possible.
This of course has to be weighed up against the danger of writing overly terse code, which might be hard to maintain.
"It took Loris ten minutes to eat a satsuma . . . twenty minutes to get from one end of his branch to the other . . . and an hour to scratch his bottom. But Slow Loris didn't care. He had a secret . . ." (from "Slow Loris" by Alexis Deacon)