Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Catalyst vs CGI::Application

by kingkongrevenge (Scribe)
on Oct 17, 2007 at 16:43 UTC ( #645497=perlquestion: print w/replies, xml ) Need Help??
kingkongrevenge has asked for the wisdom of the Perl Monks concerning the following question:

I did some searching and failed to find much writing comparing Catalyst and CGI::Application. This thread is the most in-depth thing I have found, and it's a couple years old. The CGI::Application site has a comparison table, but it doesn't constitute a review of which provides a better experience. That's what I'm looking for.

So does anyone who has used both have any comments and a vote one way or the other? Personally, I'd rather not have to invest time using both to make up my mind.

Replies are listed 'Best First'.
Re: Catalyst vs CGI::Application
by dragonchild (Archbishop) on Oct 17, 2007 at 16:56 UTC
    Having used both extensively, I would say the following:
    • Catalyst is much more powerful and expressive. It allows greater reuse of code and provides much better abstractions than anything I've seen, other than Rails. That said, the learning curve is very steep. I was able to learn how to use Catalyst under mst, the lead developer. I would strongly urge you to find someone on the devteam and crib from them.
    • If you don't need Catalyst's power, CgiApp is a perfectly capable framework. It's extremely easy to learn and has a lot of power to it. It's so simple that you can just read the source - it's just one file. The test suite covers most everything and can be read and understood in an afternoon.

    Basically, Catalyst is much harder to learn, but can give you more expressiveness. CgiApp doesn't have as much power, but does what it does simply. If you want something you can understand in an hour and that's perfectly fine, use CgiApp. If you are going to need a lot of raw power and are willing to invest a good deal of time and drink a whole bunch of kool-aid, then Catalyst is what you want.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

      (Yes, this is an addendum to the original question (which I did not pose).)

      As you have used both extensivly, could you come up with some simple speed benchmarks? Also, which one scales better under load (think very large number of hits)? And which one has a smaller memory footprint? Yes, I agree power and expressivness are important... but they are not the whole picture (<jest>if they were, everyone would be using Lisp *ducks* :-D </jest>).

      Update: Added <jest> tags (because I realized what I wrote could possibly be taken seriously (which I did not intend)).

        CgiApp will have a smaller footprint as it uses less modules and, frankly, does less. That said, the Catalyst devteam is very keen on scaling. Now, a major piece of this is how you deploy. Most CgiApp deployments that I've seen/heard about are done under mod_perl. Catalyst tends to deploy under FCGI. That can make a huge difference in your overall memory footprint (MP is often better) and scalability (FCGI is designed around scalability). As for HUGE number of hits, I'd say they can both handle it.

        And, if expressivity wasn't important, you'd be using C and not Perl. Plus, Lisp often beats out C in the Language Shootout. We don't use Lisp because it's not fashionable enough to have a big enough ecology around it. Perl is Lisp minus a few features, but plus CPAN. Perl 6 is meant to be Lisp + CPAN, no minuses.

        My criteria for good software:
        1. Does it work?
        2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
Re: Catalyst vs CGI::Application
by perrin (Chancellor) on Oct 17, 2007 at 19:32 UTC

    I gave a presentation about this at YAPC and OSCON a couple of years ago. You can find my slides here and the sample code here.

    In short, I found no important differences in the code you need to write with either one. You might choose one over the other because you like a specific plugin that it has (e.g. Catalyst's session plugin or CGI::App's ValidateRM plugin), or because you like or dislike the syntactic sugar that Catalyst uses. You can also do more with URL mapping in Catalyst without writing code. (You can do all the same mappings with CGI::App, but you'd have to write code to implement some of them. The Catalyst mappings are essentially configuration driven.)

    There is also a distinctly different flavor to the communities around them, as you will see if you browse a bit of the mailing list archives for each of them.

Re: Catalyst vs CGI::Application
by sundialsvc4 (Abbot) on Oct 30, 2007 at 00:41 UTC
    I am currently "on the horns of the same dilemma." And in my case, it is for a fairly modest web-site whose content will actually, for the most part, be static. What is important in my case, and I suspect also in King Kong's, is "will I box myself into a hole and just have to start all over again?" I personally would like to see more coverage in-general of web sites that are NOT blogs, are NOT content-management systems for the uninitiated. In other words, the sort of "on-line marketing-communications -slash- customer-support site" that tens of thousands of companies big and small actually have. So let's try to open up this conversation a little bit more. Let's say that the site isn't a blog, isn't going to have tens of thousands of hits an hour, needs to be fairly simple to manage, and will be shepherded by a Perl-person who certainly wants to improve his-or-her coding and management skills without becoming bald in the process... What would you say to them, and why?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://645497]
Approved by kyle
Front-paged by Arunbear
[Tux]: chacham I did not want to also list Committed changes to the core or core modules and (Co-)Organized a perl event

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2017-05-30 14:33 GMT
Find Nodes?
    Voting Booth?