Linked by Eugenia Loli on Sat 15th Jul 2006 22:45 UTC
.NET (dotGNU too) Jeff Cogswell writes: "I'm about to make a confession. Even though I've written several books and articles about C++, I have a secret: C++ isn't my favorite language. I have lots of languages that I use, each one for different purposes. But the language I consider my all-time favorite is Python."
Thread beginning with comment 143946
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[9]: Python is . . .
by Cloudy on Mon 17th Jul 2006 17:58 UTC in reply to "RE[8]: Python is . . ."
Cloudy
Member since:
2006-02-15

It can be acceptable to jump into a common error handling block inside a function, but nothing else.

Read Knuth's paper. There are several valid reasons for using a forward goto.

And even there, the code can be refactored to avoid it, with other benefits besides eliminating "goto"s.

Not always true. Especially when you have code that obtains resources in a certain order, operates on those resources, and then releases them in the reverse order, but has to bail if it can't obtain all of the resources. The cleanest way to write this code in C is to use forward gotos.

Other possible uses are in jumping out of deeply nested loops, but if you are doing deeply nested loops, then your code is broken far beyond the use of "goto".

Unless you're writing code that models N dimensional mathematics, such as physics simulation code, in which case deeply nested loops in non-vector languages is the only way.

Reply Parent Score: 1