cypherpunk wrote:The RMI code is essentially the same code, just ported over to Java. Of course, Java (like many poor craftsmen) chooses to blame the tools, so no goto. They do, however, have these wonderful named loops.
There is a reason that Java has no goto. Which is that they actually read Knuth. He has a comment there about a theorem that says that any algorithm that can be written with goto can be written exactly as efficiently out of it if you have named loop control. The other useful use he identified is better done by exceptions, leaving no useful uses of goto.
This is not entirely
true. Perl has the same basic facilities that Java has, but I've still seen 3 useful uses of traditional goto in Perl over the years. (Perl has 2 gotos, and the other is moderately useful on occasion.) The first was in s2p, it was easier to turn goto's in sed into goto's in Perl than to try to rewrite with labelled loop control. The other two times it was used because someone needed a construct that had to interact correctly with any combination of flow of control constructs written by other programmers. None of those situations should show up in normal programming.