Software Development

Pic: The greatest programming tip ever written

Here's an ingenious little tip to all programmers that will (viciously) guarantee an improvement in the quality of the code you produce.

goto.jpg

Here's an ingenious little tip to all programmers that will guarantee an improvement in the quality of the code you produce -- one that somebody included as an advisory pop-up for MS Visual C++. Found via reddit.

About

Jay Garmon has a vast and terrifying knowledge of all things obscure, obtuse, and irrelevant. One day, he hopes to write science fiction, but for now he'll settle for something stranger -- amusing and abusing IT pros. Read his full profile. You can a...

14 comments
martin
martin

If this is the best tip ever (and I can't think of a better one just now, although my documentation seems in disorder), then why isn't this tip in every week's issue?! I see that there are comments from 2007 and 2010. Nothing has changed..., or ...?

zackers
zackers

All it took for me to improve my coding and doc was the first time I had to fix a bug in code I wrote three years before. Trying to figure out why I did something the way I did when I couldn't remember all the details was enough to get me doing a better job.

Tink!
Tink!

EVERYWHERE! Not just coding.

Elvis.Is.Alive
Elvis.Is.Alive

What do you do if you ARE that maniac serial killer? How would you go about finding out where that programmer lives who wrote the crap-code that you now have to maintain? ... :)

Can't agree more!

theknitter
theknitter

I know someone who'd like this ....

gfhavewala
gfhavewala

If only every programmer kept that in mind, the computing world would be a much better place!

hkwilkes
hkwilkes

I guess that means Washington state doesn't have enough maniacs, we wouldn't have gotten past Windows 3.1 if it had. By the way, why do I have to select a "category" when you don't have any? You have "tags".

atrue
atrue

I think the best tip is "Never test for a condition that you don't know what to do with." Especially when doing real time programming.

Peleg
Peleg

and it was down the hall from my office. Everytime I saw him, I thought of how best to murder him. A slow, painful, screaming, bloody demise. But no torture I could ever come up with seemed to be enough for his heinous crimes, so, in the end, I had to let him live. In my 35 years of programming, his code ranks well-above any other as an example of how not to do it, and I've seen some bloody messes. On the other hand, I've learned a tremendous amount from working on code written by really excellent, world-class programmers. Finally, I always code as if I am going to be the next person to work on it. It often turns out to be the case when I have to go back to something I wrote a few days, weeks, or months later to fix something or add a feature.

Dr Dij
Dr Dij

I'm tempted to go on a shooting rampage if I ever see a buffer overflow flaw causing someone able to take over your computer again.