Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

RE: RE: Get those parameters without CGI.pm

by j.a.p.h. (Pilgrim)
on Jun 22, 2000 at 03:17 UTC ( [id://19364]=note: print w/replies, xml ) Need Help??


in reply to RE: Get those parameters without CGI.pm
in thread Get those parameters without CGI.pm

Well, instead of just telling me it's bad and doesn't solve anything, how about telling me what I could do to improve it? I doubt you wrote wonderful, perfictly optimised code shortly after you started learning perl.

Replies are listed 'Best First'.
RE: RE: RE: Get those parameters without CGI.pm
by merlyn (Sage) on Jun 22, 2000 at 16:06 UTC
    I didn't write great code right away. Sometimes, I don't even write good code now, and I'm always looking for feedback about what I could have done different or better.

    The point is that a beginner does not rewrite an expert's code (CGI.pm here) and say "I have a better way". This is not hubris. This is arrogance.

    Only when you understand why CGI.pm is the size that it is, can you build upon the art as an improvement. There are a lot of things that have to be done right to handle security; and a lot of others that also have to be done to handle portability. There's a cost to that, and you gotta pay the piper at some point; not cheat and pretend you can get away without it.

    -- Randal L. Schwartz, Perl hacker

      I never said I have a better way. I said, "this is what I use." Show me where that says it's better than CGI.pm. No where. Did I rewrite an experts code? Anything I write has probably already been written by somebody, somewhere. Does that mean I'm trying to prove I'm better than someone else? No. I'm trying to learn how to program something for myself.

      Is my code not portable? Is it insecure? How about actually giving me a few pointers on how to program better instead of cutting me down.

        I, for one, feel this defensiveness is unjustified. merlyn wasn't insulting you, he was warning you not to do work or reinvent the wheel when it wasn't necessary. He was pointing out that there are some amazing modules available and that you probably shouldn't rewrite them, just to say you did.

        This isn't cool.

        J. J. Horner
        Linux, Perl, Apache, Stronghold, Unix
        jhorner@knoxlug.org http://www.knoxlug.org/
        
      I am a basic newbie, but I agree with Randal. It is, however, sometimes quite necessary to "reinvent the wheel" for yourself to really understand why things are done the way they are. You learn anatomy by sticking your hands into a cadaver not by simply reading a book. The true path to knowledge is sometimes read and gui. Blind acceptance does not build knowledge. But open minded exploration does.
        And when you do that, you keep it to yourself, or you show people only within a frame of "I'm attempting to recreate a masterpiece... how am I doing?", not "Here's my new improved masterpiece" - that would be the arrogance I referenced earlier.

        -- Randal L. Schwartz, Perl hacker
        Be sure to read my standard disclaimer if this is a reply.

RE: RE: RE: Get those parameters without CGI.pm
by davorg (Chancellor) on Jun 22, 2000 at 11:53 UTC

    Which is, of course, why using modules is such a good idea. That way beginners don't need to write own (potentially flawed) code. They can reuse code written by experts and debugged by usage on thousands of servers over many years.


    --
    <http://www.dave.org.uk>

    European Perl Conference - Sept 22/24 2000
    <http://www.yapc.org/Europe/>
RE: RE: RE: Get those parameters without CGI.pm
by KM (Priest) on Jun 22, 2000 at 03:41 UTC
    He implied how to improve it, delete it and use CGI.pm. One way to become a better programmer is to not reinvent wheels which already roll.

    Cheers,
    KM

      And what if I need to do something similar, but can't use CGI.pm to do it? There's obviously some way it could be better. But apparently, no one knows how. Thanks for the help.
        Sorry. That just doesn't make sense. CGI.pm is included in all recent (from 5.0 onwards, I believe) perl distributions. Even if it isn't included (at which point you should fire your sysadmin) you can still use it.

        You should take a look here. You can always use CGI.pm.

        Don't give a 'what if'. Tell us what you need to do that is similar. You need to parse QUERY_STRING in a 'similar' way? Maybe you want to URI decode the string, CGI.pm does that (and other modules, too). Use CPAN, grasshopper.

        Cheers,
        KM

          A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-03-29 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found