Software Development with Linux

Are Go To statements really harmful

WED, 01 JUL 2009

In 1968, Edsger W. Dijkstra wrote the now famous letter "Go To Statement Considered Harmful". You could think that this topic is now closed, but you would be wrong.

In 2005, David R. Tribble wrote a retrospective about that letter.

Yet, even more recently (in fact, yesterday), Michael Feathers posted "Ending the Era of Patronizing Language Design" at ObjectMentor.

Micheal's article isn't about Go To statements per se, but it talks about anything (security) barriers inside programming language, that are created with the intend to help the programmers. He argues that whatever barriers exist, some problem will require the the programmer break those barriers, which will result in a worse solution that if the barriers didn't existed in the first place.

Maybe instead of declaring something incorrect and "illegal" to use, we should instead teach when such special constructs are to be used. I'm not saying that we should point Go To statements everywhere, but that in some (rare) cases, Go To statements are the way to go.

Like anything, it can be used correctly or incorrectly.

As you can see by the number of comments in response to Michael, this topic is still highly debated.

What do you think about that issue?

Photo credit : Marxchivist