Hacker News new | ask | show | jobs
by Retra 3926 days ago
Theorem: "X is sometimes the right tool for the job" is true for all X.

Now could we maybe explain what jobs we're talking about and why it's the right tool for them?

2 comments

Goto is absolutely the right tool for: "the instruction pointer finds itself here, and at this critical juncture in the algorithm, one would rather prefer that it were over there, for want of correctness, if not beauty."
That is an excellent quote.

(Where's it from? Google-fu yielded nothing.)

One job is when auto-generating source code. It's much, much easier to generate a graph as a collection of blocks connected by various goto's and if statements.

This does not adversely affect modern optimizers - they'll figure out the loops from the goto graph. At least the D compiler does.