Hacker News new | ask | show | jobs
by imanaccount247 4209 days ago
Because it is written in C. "Goto statements are bad" meant: lets start using languages that offer higher level constructs to replace the current usage of goto. Things like "loops" and "functions" and "exceptions". C did not get the memo.
2 comments

> Because it is written in C.

Writing something in C does not automatically imply having to use goto.

> "Goto statements are bad"

Goto statements are not bad.

> Things like "loops" and "functions" and "exceptions". C did not get the memo.

C has loops and functions. Bro do you even K&R?

It might be a good idea to know what you're going to be talking about before opening your mouth.

>Writing something in C does not automatically imply having to use goto.

I didn't say it did. But any large enough C project will obviously use them.

>Goto statements are not bad.

Do you know what quotation marks are?

>C has loops and functions

It does not have exceptions. Which is what all the goto uses in question are being used for.

>It might be a good idea to know what you're going to be talking about before opening your mouth.

How ironic.

C has loops and functions. But you're right that modern use of goto is typically used in error handling to replace specific use cases of exceptions in a primitive way (If error, goto end of function where cleanup is done before the return statement.)
>C has loops and functions

Which leaves...

> But you're right that modern use of goto is typically used in error handling to replace specific use cases of exceptions in a primitive way

Exactly. I pointed out the context of "goto considered harmful". Obviously the one that applies to C is the one that is the reason for all the gotos in C code.