Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

(Ovid - let's look at this again) Re: RFC CGI.pm refactoring

by Ovid (Cardinal)
on Feb 15, 2002 at 22:06 UTC ( [id://145776]=note: print w/replies, xml ) Need Help??


in reply to RFC CGI.pm refactoring

I'm reading through a lot of these posts and I'm a little disheartened. Let's face it, tachyon isn't exactly coming to us with a 10 line CGI parsing routine and saying "should I upload to CPAN?". He asked for some feedback and in my mind, that translates to a code review, but many appear to object without reviewing the code! There was some limited support for this, but again, without apparently reviewing the code.

CGI.pm is a wonderful "don't leave /home without it" sort of module. However, it does have some significant issues that warrant competition. CGI::Lite seems to be well-regarded as is Apache::Request. Is that it, though? Is this all that we allow in the club? CGI::Simple seems to be a promising way of overcoming many of the typical "I won't use CGI.pm" objections.

A while ago, tachyon and I were talking about this and I reviewed his code. While I made a couple of suggestions, for the most part, I liked what I saw. What really impresses me about this effort is that, with just under 1000 unit tests (going by what tachyon said), he states that this module passes 100% of the tests. Note that these include all of the CGI.pm tests. So, if the test suite is complete, we have 100% backwards compatibility with a lightweight, well-written module. I think that's something to consider.

Yeah, we can say that "CGI.pm" works, don't use anything else, but what does that get us? Stagnation. Let's try new things. Let's experiment. Even if this code offered no advantages other than much cleaner internals, it should be worth considering on that basis alone, not just dismissed out of hand, as some here seem to have done.

This isn't to say that we all need to rush forward and embrace what tachyon has done, but I think we should give it more consideration that what has been done here. Let's look at the features:

  • 100% backwards compatible to CGI.pm for the functions it chooses to implement.
  • strict and warnings compliant.
  • Faster during runtime (this, of course, would be a spurious benefit if it didn't live up to its other claims).
  • Possibly faster compilation time (useful in a straight CGI environment).

Now, if you have to have those HTML generating functions, don't use CGI::Simple. Frankly, I use those HTML generating functions if I'm doing something really, really minor. Otherwise, though, I use templates. If I use templates, CGI::Simple perfectly fits my needs. If this gets to the CPAN, I'm really going to give this module some serious consideration.

Cheers,
Ovid

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

  • Comment on (Ovid - let's look at this again) Re: RFC CGI.pm refactoring

Replies are listed 'Best First'.
Re: (Ovid - let's look at this again) Re: RFC CGI.pm refactoring
by tachyon (Chancellor) on Feb 16, 2002 at 00:21 UTC

    Thanks for your post Ovid As it happens I have posted the relevant benchmarks at CGI::Simple vs CGI.pm - Is twice as fast good enough? The title is self explanatory but the actual results are interesting. You may not have realised how much of a performance penalty use strict; applies for instance.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

      Read about module the bugs. These bugs should be fixed:
      http://rt.cpan.org/Public/Dist/Display.html?Name=Cgi-Simple

      Best regards,
      Webmaster33

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-04-19 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found