AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Do You Know What Go-to Statements Are?
John Carmack: I was always told in the beginning that, you know, a lot of these go-to statements. That's really bad programming. Is this correct or not? Jumping around code. Sometimes they're the right thing to do. Usually it's because there's a language feature missing like nested breaks. It can sometimes be better to do a go-to cleanup or go-to error rather than having multiple flags,. Multiple if statements littered throughout things. But it is rare. If you grip through all of my code right now, I don't think any of my current code bases would actually have a go-To.