Quote:Original post by eedok
If something was completely useless they would have removed it from the language,
Legacy code support. If it wasn't for this, then goto would have been removed a long time ago. They just didn't want to break backwards compatibility.
Quote:
it's not so much as goto is a horrible disease that plagues whatever touches it, as much as it's goto is very easily misused.
Oh, give me a break. In 99% of all cases, using goto is a sign of incompetence. Just because Torvald does it will suddendly make it less evil ? I don't think so. Especially if it is so blatantly abused as in his code - see below:
Quote:
If you think there's unnecessary goto's in some of his code, refactor it to get rid of the goto, test it, then submit it as a patch.
The first instance of goto in the piece of code I linked to earlier:
void release_task(struct task_struct * p) 136 { 137 struct task_struct *leader; 138 int zap_leader; 139 repeat: 140 atomic_dec(&p->user->processes); [... blabla ...] 173 p = leader; 174 if (unlikely(zap_leader)) 175 goto repeat; 176 }
If *that* is not one of the most blatant abuses of goto I have ever seen, then I don't know what is. Now that's going to be
really hard to remove... There's 10 other gotos that follow, only in this single source file.
Quote:
I agree with the best programmer is the one who gets things done, I generally use the best offerings for whatever task I have at hand, and the ones that are finished are usually much better than ones that don't work.
Yeah, and the ones that are completely unmaintainable. Or the ones that you have to restart from scratch, just because your customer wants a tiny little modification, and rewriting the whole thing suddendly is less expensive than having someone shift through the chaos source.
I find it funny how many people, when talking to newbies, always preach about good coding practices, evil gotos, and how great features such as reflection, native lambda functions, and all the other stuff C++ doesn't have can be. But suddendly all that is relativated and forgotten, just because some well known guy with a superiority complex spits out code that would be classified as an abomination, was it written by anybody else.
Bah.