Welcome to the Monastery | |
PerlMonks |
Re: Re: Re: Re: Sub-initiate needs help getting startedby agentv (Friar) |
on Aug 28, 2003 at 05:18 UTC ( [id://287246]=note: print w/replies, xml ) | Need Help?? |
But a system that is contained within one 8000 line file with few or no comments, doc, no warnings and no strict, and lots of global variables named in the form g_xxx is almost certain to be shit code. It is hard to imagine anyone who cared writing anything decent that matched this description. ...I'm inclined to agree mostly with this. But I still consider it to be mostly superficial evidence. In aggregate, I'd expect it to be a code base of which I'd be wary myself, but from just the facts we have, it could be that the code is well written enough that comments would be superficial (the chances are slim, but it's possible), and that it's laid out well enough to provide its own documentation. I can certainly write code that well, and I know that many of you think that you can too. The use of -w and strict was not nearly so universally expected as recently as 5 years ago. And I'd be willing to be that this code has evolved over a fair amount of time. This doesn't sound like a two-month hack. (Unfortunately, it sounds more like a 4 or 5 year hack.) The 8000 line thing looks pretty grim to me, but my reaction to the global variable thing was to say to myself, "Good, at least he used a naming convention for those." But here's my main point. I believe in clean, readable code every bit as much as the next person. In fact, I proclaim whenever I teach, that "Vinny's Second Law of Programming" is "Thou shalt make it readable!" Inevitably this invites the question, "The what is the first law?" To this I reply, "The most elegant code is the code that's finished." So if given the choice of working with a body of code that is not to my taste, or rebuilding everything from scratch, I will choose to use the existing code unless it is truly impossible. The more competent I am, the more broken the target code can be for me still to succeed. Given the stated time parameters for this problem, rebuilding from scratch does not seem to be an option at all. On the other hand, assimilating horrid obfuscated navel-lint code doesn't seem to be a great option either. But there's no reason to despair yet.
...All the world looks like -well- all the world,
when your hammer is Perl.
In Section
Seekers of Perl Wisdom
|
|