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:
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 ...
Get C# 5.0 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.