Agreed. It also ties in to the "don't fix code that already works" rule. If you already solved a problem at some employer, trying to fix it in another way, and possibly create subtle bugs, is dumb, and might even qualify as a professionnal fault, as in "letting your ego (I'm zo good I can solve this in many wayz) be bigger than your duty to your company". Not to mention the fact that there are not that many ways to write a concise, clean, maintainable version of an algorithm, while retaining your own personal coding habits, your company's coding rules, etc.
For example, since we're talking Java here, I expect that two engineers solving a classic problem (say Fibonacci for the sake of example) using SUN's editing rules using the classic algorithm will write pretty much the same code.
Unless you actually invent something revolutionary, such as a new algorithm, you're mainly using simple rules, blocks and recipes. That's because rocket science or programming aren't_complicated, they are _complex_, which is very different, and doesn't mean either that they are easy. Rewriting these blocks again and again in asimilar fashion, but vonluntarily different introduces useless risks. Moreover, I can't help but find that writing code that does the same thing as code you wrote previously but is slightly different (say write two lines in a different order if it doesn't impact the algorithm, or use x=x+1 instead of x++, or whatever stupid trick...) is exactly like changing a few words/lines in an essay.(Yes, obviously, the person who wrote the essay would then be someone else, but it's just to make the point that if you end up rewriting code that's identical to code you already wrote and then have to "alter" it to avoid "intellectual property issues", you're deep in kafkaian territory). I'd even argue that code that's semantically/logically equivalent to another code IS that code... which then means that either, due to your better experience and further years of programming, you now wrote a better version of the code, you wrote the same code in a "disguised" way, you have identical code, or you PURPOSEDLY wrote worse code.
Since it seems to me that the first situation will actually rarely happen, the last situation seems like a professionnal fault and the two other solutions seem to be illegal if I read the case right... what happens then? Should programmers stop working anytime they are askedto do something that has already been done? Looks like web development would stop instantly, among many other things :D
So, what should be done? It's a complicated world where you solve real problems using "virtual" tools, such as "Law". The good thing is, real people called judges (and sometimes extremely competent ones) are designated to arbitrate these real problems :D
Talking about fixing things that worked... CAN I HAVE THE PREVIOUS COMMENT SYSTEM THAT LOADED FAST AND WAS EASY TO READ BACK PLEASE? Or maybe thereis a toggle I don't see?