Viewing a single comment thread. View all comments

Deadmist t1_iycd9gz wrote

> In C, to mimic the destructor behaviour of C++ in function.

That doesn't mean using GOTO isn't bad, it just means that there is no better option in C.
In 'modern' languages, like C++ or Java, you can achieve the same outcome with destructors or try-with-resources, without the pitfalls of GOTO.

10

Symbian_Curator t1_iyce7cl wrote

I agree, but sometimes you just have to use C and then you use the tools you have. A bad tool is better than no tool at all.

My main point was that GOTO is not always pointless/useless.

6

Clewin t1_iyd736l wrote

Speaking of, one of the biggest uses of GOTO I saw in C was for exception handling. C++ as well, until try-catch blocks were added (and that varied by compiler until the late 1990s, early 2000s).

2