In my experience, it's also come up with finite-state-machines where there's lots of loops. You might consider something like a long-lived client-loop on some socket, where states like try-connect, connected, and while-connected-and-everythings-ok exist and each can have it's own never ending loops and each loop jumps to each others section. It actually is more straightforward than adding unneeded layers like callbacks which will force you to design and pass around data, use auxiliary classes/structs, and it's easier to shoot yourself in the foot with burden and context loss that way.
-Jason On Thu, Sep 24, 2015 at 1:54 PM, Alexander Eberspächer < alex.eberspaec...@gmail.com> wrote: > On 24.09.2015 13:25, Christophe Bal wrote: > > > Can you give an example where GOTO is useful ? > > I think those pieces of code are best understood with some humour.. > > However, basically I can think two main causes for using goto: > > 1. Stop whatever your code is doing and jump towards the end of the > program. However, this is mainly something useful for languages without > exception handling and garbage collection. > > 2. Get out of something deeply nested. Also, this probably isn't very > useful in Python as there's exception handling. > > Best > > Alex > > > > _______________________________________________ > NumPy-Discussion mailing list > NumPy-Discussion@scipy.org > https://mail.scipy.org/mailman/listinfo/numpy-discussion > >
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org https://mail.scipy.org/mailman/listinfo/numpy-discussion