shavetheyaks

shavetheyaks t1_iy78ycb wrote

I hate this article too (all the "examples" they give are exaggerated and abstract, and halfway through it turns into a not-so-subtle ad for their company), but I would argue that having to use goto for those things is a (soft) flaw in the C language.

My understanding of structured programming is that they took uses of goto and built them into the language to make it easier for the compiler/programmer to reason about them. Error handling and loop restarting are structured patterns that could have been added to the language itself.

Those patterns are so few and easy to reason about that I don't think there's any reason to add things like try/catch to C, but I don't think the presence of goto in C code means that goto is necesssary or desireable (except maybe for the crazy context-switching code you'd see in an OS).

7