▲ 30 ▼ Every goto in the Linux kernel / Just another day on the linux-kernel mailing list (www.youtube.com) submitted 1 year ago by ruffsl@programming.dev to c/linux@programming.dev 3 comments fedilink hide all child comments
[–] resipsaloquitur@lemmy.world 3 points 1 year ago (1 child) People who think gotos are bad like Dan Brown novels. permalink fedilink source hideshow 1 child comment replies: [–] spartanatreyu@programming.dev 7 points 1 year ago Gotos being bad falls in the it depends category. Bad: When you think you're going to do something clever (when you should probably be reaching for a different tool that you may or may not know exists) Good: When in the form of a jump that's was written by a sound compiler When learning how assembly works When working on codecs and you're actually going to spend the many hours to get everything right. Labelled breaks in nested for loops Embedded systems when resources are constrained When writing debuggers When writing anti-cheat systems And finally, when you actually need to because you're manually managing things (e.g. you're writing a kernel) permalink fedilink source parent
[–] spartanatreyu@programming.dev 7 points 1 year ago Gotos being bad falls in the it depends category. Bad: When you think you're going to do something clever (when you should probably be reaching for a different tool that you may or may not know exists) Good: When in the form of a jump that's was written by a sound compiler When learning how assembly works When working on codecs and you're actually going to spend the many hours to get everything right. Labelled breaks in nested for loops Embedded systems when resources are constrained When writing debuggers When writing anti-cheat systems And finally, when you actually need to because you're manually managing things (e.g. you're writing a kernel) permalink fedilink source parent