Live data from Hacker News

Ask HN: Who else thinks they should add GOTO statements to Python?

news.ycombinator.com

11–14 of 14 posts

Re: Ask HN: Who else thinks they should add GOTO statements to Python?

#11

I missed goto when I was 10 and had to stop using it because I moved beyond writing BASIC on an Apple ][. I got over it. I did have to use it in error handlers in Lotus Notes apps back in the 90s/00s, but that didn't make the apps better, it just was how the scripting worked. I haven't once felt the need for a goto since then. So unless you can tell us a scenario where they work better, no - they are not needed and w…

You haven’t provided any reasons for it being bad other than it being childish. Would you mind providing a few reasons why they cause harm?

Re: Ask HN: Who else thinks they should add GOTO statements to Python?

#12

I missed goto when I was 10 and had to stop using it because I moved beyond writing BASIC on an Apple ][. I got over it. I did have to use it in error handlers in Lotus Notes apps back in the 90s/00s, but that didn't make the apps better, it just was how the scripting worked. I haven't once felt the need for a goto since then. So unless you can tell us a scenario where they work better, no - they are not needed and w…

You haven’t provided any reasons for it being bad other than it being childish. Would you mind providing a few reasons why they cause harm?

[deleted]

Re: Ask HN: Who else thinks they should add GOTO statements to Python?

#13

I missed goto when I was 10 and had to stop using it because I moved beyond writing BASIC on an Apple ][. I got over it. I did have to use it in error handlers in Lotus Notes apps back in the 90s/00s, but that didn't make the apps better, it just was how the scripting worked. I haven't once felt the need for a goto since then. So unless you can tell us a scenario where they work better, no - they are not needed and w…

You haven’t provided any reasons for it being bad other than it being childish. Would you mind providing a few reasons why they cause harm?

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/

[1] https://mail.python.org/pipermail/python-3000/2007-July/0086...

Re: Ask HN: Who else thinks they should add GOTO statements to Python?

#14
post #13

Earlier quoted context omitted.

You haven’t provided any reasons for it being bad other than it being childish. Would you mind providing a few reasons why they cause harm?

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/ [1] https://mail.python.org/pipermail/pyt…

Thanks!
Post reply on HN