On Thu, Aug 24, 2006 at 11:06:42AM -0700, Stewart Stremler wrote: > begin quoting Gabriel Sechan as of Wed, Aug 23, 2006 at 03:44:27AM -0500: ... > > In some ways its an improvement. In other ways it isn't- I'm not sure > > going from badly modularized non-OO code to badly modularized OO code or > > overly complex class hierarchies is really a step forward- if anything I > > think its a step back (additional complexity with no gain). But yes, the > > base problems and solutions are the same. > > Both cases should result in the code being thrown away -- so I don't see > that much of a difference. I think it's easier to fix up OO code, as > there are some powerful refactoring techniques that work well with OOLs, > so it may be a step back in comprehensibility, but it may be easier to > fix as well, given the right tools.
Badly organized code should be thrown away if it contains nothing worth finding, understanding, and keeping. In the vast majority of cases, the difficulty of analyzing the bad code means you shouldn't even look in it for anything valuable. IMO, this isn't _always_ true. If the bad code does anything correctly that you need and can't economically duplicate from scratch you are stuck with at least reading it. You may want to get a head start on debugging and verification by modifying the bad code, but the experience may be a surreal one. You may need to appreciate and understand the logic and achievements of a bad programmer without becoming one. If the bad code has inspired a mixture of admiration and horror among your colleagues, I suggest a bit of caution about throwing it out. It's still probably trash, but ... Stewart Strait -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
