4 ms·
The (in)famous "spaghetti code", where function is impossible to understand because of large number of goto's. The only useful purpose for goto's I can think o
by theamk 1y ago
The (in)famous "spaghetti code", where function is impossible to understand because of large number of goto's.
The only useful purpose for goto's I can think of is breaking out of mulitple nested loops, and this has been proposed in PEP 3136[0]. This has been rejected by Guido, see [1] - and every of his reasons applies to "goto" as well.
[0] https://peps.python.org/pep-3136/ https://peps.python.org/pep-3136/
[1] https://mail.python.org/pipermail/python-3000/2007-July/008663.html https://mail.python.org/pipermail/python-3000/2007-July/0086...
- n1xis10t 1y agoThanks!