Do you attract programming bugs like
A moth to a flame
A fly to rubbish
A cockroach the same
An ant to food dish
Are you a code bug magnet?
Recently, I was having dinner at a pasta restaurant. Now, when I ate at (fast food) restaurants, there seemed to be these unwelcome guests. They fly and they crawl.
Who were these guests? They’re bugs. And they bug me real good.
They linger on the table and test my patience as to how close they can get to my food. They scheme to land on my drinking straw just so I have to go get another straw. My only weapons were the blow (without expectorating my food), the wave (shoo shoo), and the ignore (hope you go away…). Generally, the better restaurants have fewer of these six-legged visitations.
Anyway, back to the pasta restaurant dinner. It came to my attention how fast the waiters and waitresses move to clean up the dishes. The moment you’re done, someone comes over to you and ask “Can I clear that for you?”. Well, it’s rhetorical, because they continue to take that plate from you anyway.
Now, for comparison, there’s another restaurant I visited. As I was eating, I saw a baby cockroach crawling around. Flies I can understand. Ants I can understand. But cockroaches were the last straw. I boycotted that restaurant.
On reflection, I realised this restaurant’s helpers were slower in cleaning up tables. As a result, the unfinished food in the dirty plates and bowls naturally attracted bugs. Slow business is not an excuse to take your time keeping the place (and tables) clean.
Now here’s the point: Once the bugs come, they are hard to get rid of. Even after you clean up, they’re still there (for a while at least). It’s like they have some memory of food being there, so even if the food isn’t there now, it’ll probably be there in a while. So the bugs stick around.
Moral of the story
Once you have messy code, you attract bugs. Once the bugs are there, it’s harder to get rid of them completely. Your best bet is to not attract them in the first place, by writing good code.
Since all humans are imperfect, therefore all code written by humans are imperfect*. That said, what you can do is write good code as best as you can. Just as restaurants (and food outlets in general) inevitably attract bugs, restaurants can still keep the place clean so as to attract less of them critters.
I don’t have a good definition of “good code”, but I do know that you need help if someone asks you (in resignation), “Are you a bug magnet?”.
P.S. Lately, I tried that restaurant that was boycotted. The place seemed better kept. My dining experience improved once those exoskeleton-donning buggers were out of my face.
* To forestall your question, no, code written by computers or robots are also imperfect. Who do you think created them computers and robots in the first place?