'goto', as an indicator of good language

IGotD- nise at nise.com
Thu Sep 8 17:04:28 UTC 2022


On Thursday, 8 September 2022 at 16:33:58 UTC, AnimusPEXUS wrote:
> There was a discussion sometime ago in a Russian Dlang Telegram 
> chat about 'goto' keyword. And there was some empiric theory, 
> stating 'all good languages support goto statement'. Nor Rust, 
> nor Carbon, nor Zig will never going to overcome D or C++ 
> because of this. Language should give possibilities, not take 
> them away. And in some cases, goto able to make code more 
> readable, more sane and more understandable. Also, goto is much 
> safer in language with GC.
>
> [corresponding section in 
> wikipedia](https://en.wikipedia.org/wiki/Goto#Criticism)

Does this apply to all languages or only "systems languages"?

If we look at current popular heavy lifting languages.

Support goto:
C#
Objective-C

Do not support goto:
Python
Java
Swift

It seems to be a bit too simplistic criteria to me.

Anyway, I haven't used goto a lot in C/C++ other than in "roll 
back error handling". D manage to do this even better with with 
its scope guards. How does other languages handle "roll back 
error handling" (is there a better terminology for this?).



More information about the Digitalmars-d mailing list