Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Get those parameters without CGI.pm

by rjha94 (Initiate)
on Dec 25, 2011 at 16:01 UTC ( [id://945067]=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

It is interesting to see how people are against the idea of writing a replacement of CGI.PM because new code is worse to begin with. However one big point in favor of this replacement code is that you can see how CGI works under the hood.

365 days of using CGI.PM as a library can never teach you that. I may not want to read the CGI.PM library precisely because it is mature and full of error checks and utilities that do not let me see the "essence". so such code at least has a __teaching__ aspect and should be applauded for that.

And maybe it is okay to reinvent the wheel once in a while otherwise we can never make it rounder..
  • Comment on Re^2: Get those parameters without CGI.pm

Replies are listed 'Best First'.
Re^3: Get those parameters without CGI.pm
by Anonymous Monk on Dec 25, 2011 at 16:47 UTC

    It is interesting to see how people are against the idea of writing a replacement of CGI.PM because new code is worse to begin with.

    Hi, you must be new :)

    For years after CGI.pm appeared, people were still brokenly reinventing it

    For years after CGI.pm was made a core perl module, people were still brokenly reinventing it, and then asking why their code is broken and how to fix it

    It is such a frequent and impressive waste of time that Ovid wrote use CGI or die; and Ovid's CGI Course 10 years ago, 6 years after CGI obsoleted all imitators

    And maybe it is okay to reinvent the wheel once in a while otherwise we can never make it rounder..

    Yes, its ok to reinvent a wheel, like reinventing aspirin, but it has to be an obvious improvement, and you have to be able to make it yourself and be prepared for the appropriate amount of criticism

    But, if you're advocating hitting yourself over the head with a rock as a replacement for aspirin , expect the worst :)

    Take a look through the bug reports and changes files some time -- anyone reinventing CGI.pm is smart enough to make thrice as many mistakes :)

    See CGI::Simple, its CGI.pm minus the html generation code (ie, its faster), written 10 years ago, through advanced reuse concept of "copy" and "paste"

    See also PSGI/Plack, written 2 years ago, it is the next generation , beyond the CGI (note, not CGI.pm )

Re^3: Get those parameters without CGI.pm
by cavac (Parson) on Dec 25, 2011 at 16:54 UTC

    Sometimes it's a good thing, sometimes it isn't. See 935499 for a discussion on that topic.

    What you have to really understand by heart when attempting such a project: Those matters are far more complex than they look. I know, i wrote my own Webserver.

    While the basics - e.g. getting the most used stuff working - is most times not that difficult, the devil is often in the details. You'll have to make the more obscure features work (like handle multipart forms for file uploads in your case and also parse headers like if-modified-since). You'll do error handling, handle interrupted connections, intentionally misformed data (hacking attempts) and such.

    And - if you publish your solution and people base their projects on it, it would be your implied responsibility to keep the API stable while still continuing development.

    If you are willing to embark on that journey, you are very welcome.

    Don't count on it beeing an easy journey or a quick one. If you succeed, it will be a personal triumph for you that may include widespread adoption of your solution. But you better plan to work hard for months or years to get to that point.

    BREW /very/strong/coffee HTTP/1.1
    Host: goodmorning.example.com
    
    418 I'm a teapot

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found