O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The goto Statement

In true C and C++ style, C# provides a goto statement to perform unconditional control transfer to a point in the code marked by a label. The greatest computer scientists have debated the use of goto for years:

Image Edsger Dijkstra, a Dutch computer scientist, published his infamous paper “Go To Statement Considered Harmful” in 1968. At that time, structured programming (if, while, and so on) was gaining popularity, and most typical cases of goto got eliminated by it. And true, use of goto all over the place quickly results in spaghetti code.

Donald Knuth, known for his “The Art of Computer Programming” series, stated this viewpoint ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required