From Jason Turner
Watch on YouTube

Summary

In this episode, Jason challenges the notion that 'goto' statements are universally evil by demonstrating how many C++ control structures are actually defined in terms of gotos in the C++ standard. He progressively transforms a simple for-loop into its equivalent while-loop and ultimately into goto-based code, showing that the compiler generates identical assembly in all cases. This reveals how constructs like continue, for, while, and switch are essentially syntactic sugar over goto statements.

Resources

Tags