http://qs321.pair.com?node_id=19361


in reply to Get those parameters without CGI.pm

I voted this code down. It doesn't solve anything in any way that makes it worth throwing away CGI.pm. It also does the de-hex slower than it needs.

Basically, it's cargo cult code. Just remove it.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: RE: Get those parameters without CGI.pm
by j.a.p.h. (Pilgrim) on Jun 22, 2000 at 03:17 UTC
    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.
      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 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.

      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/>
      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.