On Friday, 27 July 2012 at 00:57:15 UTC, bearophile wrote:
Stuart:
Why does D have GOTO? I haven't used GOTO in over a decade, because it's truly evil.

Gotos are not so evil. Just use them when they are useful and they can't be replaced by structured programming. In D I create finite state machines at compile-time that use gotos, they are quick.

 As mentioned, why would GOTO be evil?

 http://en.wikipedia.org/wiki/BASIC

I'm remembering back when i used an Atari (For others, Commodore64 and Apple IIe), where the BASIC programming language supplied (via rom or built in) didn't have function calling and instead everything used GOTO statementes (Or GOSUB).

Obviously spaghetti came about easily, but when the GOTO is dropped to only being a logical jump when no other options are available. Consider half a dozen GOTO's with labels nearby vs thousands.

Reply via email to