Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Hanging my head in shame

by decnartne (Beadle)
on Nov 30, 2000 at 19:32 UTC ( [id://44138]=note: print w/replies, xml ) Need Help??


in reply to Hanging my head in shame

For the sake of a new monk ( and perhaps others ), would you mind elaborating? I fully understand your aversion to no strict/-T/-w.

From my own observation, the indentation style is an eyesore, but other than that and the # ignore statement, what are they doing wrong? I don't do much w/ CGI, are they missing the boat with the whole approach?

decnartne ~ entranced

Replies are listed 'Best First'.
Re: Re: Hanging my head in shame
by Fastolfe (Vicar) on Nov 30, 2000 at 19:41 UTC
    1. There are already modules out there that do all of that sort of processing (namely CGI), so all of that code is unnecessary.

    2. Even if they wanted to re-invent that parsing stuff, they could have reduced their code to, like 10% by just pumping the name=value items into a hash instead of global variables.

    With any CGI script, you almost always want to be sure your script works with taint-checking enabled. This prevents people from possibly passing specially crafted, unsafe arguments to your scripts where you don't expect it, with the intent of getting those strings injected into various system commands. Taint checking does a fairly good job identifying areas where this can happen. And the use of strict/warnings means that it's infinitely easier to track down bugs or problems with the code. A large script developed without strict or warnings probably has a few undiscovered/untickled bugs that would have been identified by now.

      after posting, i thought perhaps that your #1 might be the case. thanks for the clarification.

      decnartne ~ entranced

(Ovid) Re(2): Hanging my head in shame
by Ovid (Cardinal) on Nov 30, 2000 at 22:45 UTC
    From my own observation, the indentation style is an eyesore...
    Just thought I would mention this in passing: lack of indentation is more than an eyesore. It's indicative of sloppy code. While indentation is not required to get a program to run (see Obfuscation), it's a great way to view the logical structure of your code. The only reason I took the time to understand the code on the site I listed is because it was not indented. It's been my experience that code that is not indented is likely to be more buggy than normal.

    Quite often, indentation can let you see at a glance large sections of code that are not applicable to what you are working on (if/elsif/else structures being great examples). Without indentation, keeping track of those sections becomes a pain and slows down your work, raises your company's costs, and, as you mentioned, is an eyesore :)

    Cheers,
    Ovid

    Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-03-29 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found