Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was brought up on the GOTO statement in Fortran before the GOTO police outlawed it, so I'm quite familiar with its operation.

Nowadays there's more consideration given to structured programming and that's a good thing but that doesn't necessarily mean that GOTO should never be used—and if it is then it doesn't mean the whole structure of one's program ought to be called into question.

No doubt GOTO can be dangerous and can lead one into bad habits but in certain instances it can simplify code and make it less prone to introduced bugs. Modern coding practice teaches us to recognize and avoid spaghetti code so with those constraints in a programmer's mind he/she should be able to use GOTO effectively and with safety.

The key issue is to know when it's appropriate to use it and when not to.



GOTO is like profanity: it can be useful when done sparingly, but your peers will start judging you if you rely on it too often.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: