in reply to CGI made me bloated

First off, I'm a grump. I'll admit it, so don't take it personally.

Let's start with the name. I see no point in renaming it unnecessarily. I see no point in lengthening the name, either. Then again, I've seen a lot of people abbreviate the oh-so-difficult to type 'you' to 'u', saving a whopping TWO characters per time! (Moral of the story, keep frequently used names short.)

I'm not sure what LWP has to do with *server-side* CGI programming, so I'll leave that alone. You lost me.

Now for the bloat. Let's have some figures. How much space are the unused functions taking up? Do you realize that they're autoloaded when necessary, by default? How about the savings the OO interface provides by not importing symbols?

There are legitimate gripes -- Lincoln does say it does too much in the documentation. He wrote his own autoload scheme. The HTML functions should be split into another module, loaded only when necessary. The dual OO-procedural interface sucks. From personal experience, though, he accepts patches. Start with perldoc -m CGI.

It's not like you don't have other good choices, too. There's CGI3 (yes, the successor to CGI.pm, though not quite ready yet.) There's CGI::Lite. You're even welcome to write your own.

To answer your last question, though, it'll be time to stop using CGI.pm when there's a good, well-tested, and robust alternative. Maybe you're the one to write it.

Update: "Bloat" is such an ugly word. I'd like to see someone actually measure it sometime. There are good reasons to be concerned about CGI.pm, and, in my opinion, you haven't hit many specifics. "I think it's bloated, and it's possible to have namespace collisions with the procedural interface."

You're welcome to think that way (and the collision part is right, but it's possible with lots of modules, if you're not careful), but I'd like some facts. If its perceived bloat is such a problem, surely that would be worth measuring. Otherwise, how can anyone write a replacement and prove it's any better?

Replies are listed 'Best First'.
Re: Re: CGI made me bloated
by mattg (Novice) on Oct 31, 2001 at 10:44 UTC
    It seems I wasn't being quite so lucid with my original thought, so I'll post once more to say that it is not that I think LWP should replace CGI. I take full blame for making my post a little unclear on that point...

    My point, in fact, is that most people will strive to make their code as compact and efficient as possible, so why is it such a crime to abhor bloating in modules? If I haven't made my arguments agains the bloat clear, I also haven't heard any decent reasons why it remains. So far the responses have gone along the lines of "it's not killing me, so who cares?" And there's nothing I revile more than apathy. I hope it's not the sound of M$ worshippers I'm hearing (who cares about the excesses, it's easy to use!). Now to see how many feathers that remark ruffles... ; )

    Back to the topic at hand, however, I'll throw out this quote from a message brian d. foy posted on alt.perl about the "dangers" of CGI's namespace hogging:

    (the function names) conflict with similar function names in other modules one is likely to use with CGI.pm, such as URI.

    I won't pretend to be a perl guru, so my writing a new CGI module will have to wait a while. To show my ignorance, until I read that post I had been happily using CGI without a care in the world. I now find myself a little more wary about where and how I use the CGI module, and that's what prompted me to start this thread.

    matt