DEV Community

loading...

Discussion on: 10 rules to code like NASA (applied to interpreted languages)

Collapse
elmuerte profile image
Michiel Hendriks

The generations that came out after goto was considered harmful did indeed avoid using it. We're at the stage where we're debating if continue is goto and thus should be banned.

This not what Dijkstra was talking about. Dijkstra wrote that essay before we had structured programming. Where you did not call a function or method. But you had to jump to places. Make sure you prepared the stack correctly, and hope the target location did not change.

None of the "modern" languages support these types of jumps. The continue or break to a specific label is not the same, as it is still strictly scoped.

Collapse
xowap profile image
Rémy 🤖 Author

I'm not sure if you've already used goto but the few times where I thought that Dijkstra was wrong it felt like having main brains smashed in by a slice of lemon wrapped round a large gold brick. Whichever the language.

Collapse
elmuerte profile image
Michiel Hendriks

I have programmed in Basic. I have written code with line numbers. I have messed up that code.

Jumping to the wrong line was so easy, and so difficult to figure out.

Thread Thread
xowap profile image
Rémy 🤖 Author

Those were simpler times 😢