Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

(kudra: clarification) RE: Code Clinic

by kudra (Vicar)
on Nov 09, 2000 at 20:13 UTC ( [id://40735]=note: print w/replies, xml ) Need Help??


in reply to Code Clinic

I should point out that my comment followed arturo's description of some horrible code. There've been a few nodes discussing how horrible things can be (I'm too lazy to look up more than one link), but it's probably nicer to try to explain why things are horrible and clean them up (as in Ovid's CGI tutorial spec, and arturo's suggestion). I was actually just commenting on how much fun it is to be cruel sometimes.

But then arturo suggested making it nice instead of mean. I do like looking at code and reading why it is bad and how it can be improved, I'm not sure I'm completely convinced it warrants its own section...we've got quite a few sections and there could be some confusion. And there's also the question of if anyone wants to correct code that the poster already knows is horrible (I assume anyone whose own code is having problems will post to SoPW). So I'd like to see posts like that, but I don't know that they need a section.

Replies are listed 'Best First'.
RE: (kudra: clarification) RE: Code Clinic
by arturo (Vicar) on Nov 09, 2000 at 20:32 UTC

    I could almost write a book; I wouldn't say the code I maintain is downright *horrible*, because it does get the job done, and it does a remarkably complex task. Also, the code author learned Perl as she developed this working code. Quite an impressive feat, IMO.

    One part of this large system (of legacy code) I maintain is replete with globals, some of which get set in various subroutines, not a package in sight, very little thought given to code re-use, and 30-line subs that do things that a routine like

    sub percent { my ($num, $denom) = @_; $denom > 0 ? sprintf("%2.1f%%", ($num/$denom) *100) : "00.0%"; }
    does.

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://40735]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (1)
As of 2024-04-24 14:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found