Il y a fort longtemps, ce bon vieux (vénérable et vénéré) Dijkstra a pondu un essai célèbre, A Case against the GO TO Statement aka Go To Statement Considered Harmful, qui dit en gros que goto saymal. Je me permet de citer la phrase qui résume son idée:
The go to statement as it stands is just too primitive, it is too much an invitation to make a mess of one's program.
Depuis lors, ce pauvre goto à été associé comme quelque chose d absolument diabolique et néfaste, à bannir de tous les langages, bouquins et esprits. Limite si en travaux pratique de programmation, quand tu pose une question sur goto à un assistant il te dit pas chuuuuuut, moins fort, de peur que tu infectes les autres élèves. Il y en a aussi qui t'enlève des points juste par principe, parce que t'as osé aligner g, o, t et o dans ton programme, et que goto, saylemal.
c'est la fête de la quote
En voilà une de Getting Real (bouquin sur lequel je ferais un post très prochainement)
Programing is all about decisions. Lots and lots of them. Decisions are guided by your cultural vantage point, values, and ideals.
Voilà, on en est là. Nos valeurs et notre idéal est goto-less grâce (ou plutôt à cause) du Dijkstra spirit qui est toujours très présent dans le milieu académique, alors que le contexte dans lequel il a écrit cet essai n'est plus du tout pareil.
goto considered helpful
Parmis ceux qui trouvent que goto c'est d'amour, on trouve des exemples (en C) assez flagrant qui prouvent que, à condition d'être bien utilisé, c'est quand même bien pratique. Plutôt que copy-pasta tout ça, voilà des liens intéressants sur le sujet:
securecoding.cert trouve que goto pour gérer les erreurs en C c'est bien, wikipédia en parle au sujet du RAII, même Linus Torvald aime bien un peu de goto dans son kernel, et Dieu (aka Knuth) aussi trouve du bien dans goto. Pour finir en beauté, une quote de de Christian Bau sur comp.lang.c trouvée là:
If anybody asks for advice whether to use goto or not, you should tell them not to use it. People who ask for advice shouldn't use goto.
At some point they will not ask for advice anymore, and at some point they will either start thinking for themselves or they will not. If they think for themselves, they will use goto when it is appropriate and avoid it when it is inappropriate, and if they are smart they will know when it is appropriate. If they don't think for themselves, they will still insist that goto is always evil.
Usual indication of "not thinking" is when you present an example that is more readable because it uses goto, and they insist that it is worse because it uses goto. So the conclusion that they draw is that using "goto" is bad because you use "goto".
It is pretty useful in certain situations.