On Friday, July 27, 2012 03:58:52 Stuart wrote: > On Friday, 27 July 2012 at 00:23:54 UTC, Ali Çehreli wrote: > > Welcome! :) > > > > GOTO is evil; 'goto' is not! ;) goto makes switch-case > > > statements safer in D: > Well, kinda. "Goto case" and such are one thing, but allowing the > arbitrary use of goto for jumping around from label to label.... > I just don't understand why the language even supports this. > Anyone using 'goto label' in their code is doing it wrong. Period.
You're going to find plenty of people who disagree with you when dealing with a systems language. Particularly when dealing with low level code, gotos can be very useful. Granted, if code is littered with them, there's no question that there's a problem, but there are definitely cases where using goto actually improves code - especially when efficiency is a major concern. They're just relatively rare. Other, good, language constructs make them far less necessary than they once were. - Jonathan M Davis