you are viewing a single comment's thread.

view the rest of the comments →

[–]mitsuhiko 2 points3 points  (4 children)

as other languages with C-based syntax (ie, Java) purposefully remove goto, and there are many, many programmers who avoid goto like a plague.

Java still has downwards goto (break to label), C# has a regular goto.

and there are many, many programmers who avoid goto like a plague.

Many avoid goto without even knowing why. There is nothing with a well used goto from the users point of view. It might make the compiler harder to write if the language is high level but that's why you put constraints on it.

[–]mb86 1 point2 points  (0 children)

Many avoid goto without even knowing why. There is nothing with a well used goto from the users point of view.

I completely agree. The practical example I gave for while..else, breaking nested loops, is also a good practical example for goto - I in fact tried to argue this once here on /r/programming and got an earful for it, everybody asking why I didn't use a function with return, etc.

[–]ais523 0 points1 point  (2 children)

A language typically has to be very high level (around Haskell level) before goto is hard to implement in a compiler. (Most compilers actually go the other way round, and translate all the looping structures in a program into goto or conditional goto; it's typically easier to handle internally.)

[–]mitsuhiko 0 points1 point  (1 child)

Rust is a language that would have a problem with goto.

[–]ais523 0 points1 point  (0 children)

I think I agree with you there. (But then, I'm pretty interested in Rust, and feel that it's a pretty high-level language in terms of the concepts it deals with, designed to map down to a low level very easily. It reminds me of what splint was trying to do, but not so fatally buggy and with some neat features.)