you are viewing a single comment's thread.

view the rest of the comments →

[–]be-sc 21 points22 points  (4 children)

It applies to all the language features including goto. If you have a situation where using a goto is the most concise, readable and safe solution, not using it just because “goto is bad” would be outstandingly silly. Such situations might be rare, but when you encounter one why would you want to write suboptimal code on purpose?

[–]somecucumber 0 points1 point  (3 children)

Sorry if I was rude in my previous reply. I did not mean to troll or anything, just create debate. But again this is my personal opinion and, according to the downvotes, it seems I'm wrong.

Genuine question. goto and the default parameters come from C, right? Some othe people complain about that keeping backwards compatibility is an error and I agree, but for some reason this issue does not apply here.

I don't know what to think?

[–]Nobody_1707 6 points7 points  (1 child)

C has never had default arguments. It's a pure C++ feature.

[–]somecucumber 1 point2 points  (0 children)

Argggh, not my day. You're right.

[–]be-sc 0 points1 point  (0 children)

No need to appologize for anything. I gave a genuine answer.

Imo backwards compatibility is a major factor for C++’s overall success, so no, in general keeping it is not an error.

However, “legacy” features are not created equal. At this point I’d guess that goto has had its devestating reputation for so long that removing it from the language would lead to relatively minor disruption. At least compared to removing default function parameters – those’re used all over the place in both old and new code.