actualize has asked for the wisdom of the Perl Monks concerning the following question:

In order to keep track of our company assets I started entering data into a MySQL database. I planned it out, and thought it would be a good idea create a CGI interface that grabs and presents data with DBI. I was able to get something simple up that has a pull-down menu that shows the selected user's assets when a submit button is pressed. As I started getting ready to increase the functionality of my plucky little application, I started thinking about file structure because I figured as the application started to get bigger I would want to make sure that my code was organized. I was more than happy to include all of the right modules in my own application, but after thinking about the replies I received and reading about mvc in Joost's article, then seeing what maypole could do, I started doing the Catalyst tutorial and found it to be quite useful.

However, I see a drawback in that I am not writing as much of the application and thus am not learning as much perl. I feel this is made up a certain amount by the fact that I am learning how more experienced perl hackers are doing things. For example, I am being exposed to database schemas. I never would have thought to do that with my queries if I hadn't started playing with Catalyst. I guess my question is this:

When considering the merits of working with the catalyst framework(faster deployment) and the drawbacks (not learning as much perl as catalyst object structure and templating), Is working with catalyst good or bad for my perl education?

My end game is to get more perl work; so I figure if I can deploy quickly and my web app is impressive, then it should be a good thing. What do you think? Am I going in the wrong direction? Will I get a more perly experience if I use something like CGI::Application?

-Actualize

Replies are listed 'Best First'.
Re: Is using Catalyst cheating?
by leocharre (Priest) on Jul 24, 2008 at 02:00 UTC
    No.

    Somebody wrote something about the difference between a programmer and a developer.

    A programmer loves to code, and will do so- for the love of coding.

    A developer will first look for a way not to do it- find an existing solution. If none is available- coding may be in play.

    Catalyst, CGI::Application, are there for use. They are meant to be used. There is no more cheating using CGI Application and Catalyst than using open(), or perl itself for that matter- instead of rolling your own- and while you're at it- write the damn os and machine code too :-)

    There is no cheating.

    If you are using frameworks instead of rolling your own- you *are* learning perl.

Re: Is using Catalyst cheating?
by Joost (Canon) on Jul 24, 2008 at 01:01 UTC
    Thanks for linking to my site :-)

    Anyway,

    Having a (couple of) good framework(s) to start with will certainly help you get a handle on the problem. In the end though, there's nothing like building something from scratch to really find out where the difficulties and trade-offs are for that particular problem.

    I'm not sure what I would suggest if your goal is to learn as much as possible. Probably to try a few different frameworks, maybe learn one or two of them fairly well, and then possibly try and create some framework better suited to some new problem that doesn't get served very well with the existing ones.

    Note that none of this is particularly about learning Perl. Having a good overview of (how to deal with) the problems in your domain is more useful than having in-depth knowledge of the programming language "of the moment". But using a good framework will also help you understand Perl better, and if the choice is between writing a new framework with minimal perl knowledge and using an advanced framework (and so, being exposed to probably more advanced perl code), you might just learn more (Perl) by using the existing stuff.

Re: Is using Catalyst cheating?
by jethro (Monsignor) on Jul 24, 2008 at 02:45 UTC
    If you have finished your current project faster because of something like Catalyst do you a) stop programming since there is nothing more to do or b) start your next perl project ? If your answer is a, then yes, you haven't learned as much as perl as you could ;-)

    More to the point: Nobody anymore thinks of cpan as something separate from perl. cpan is the library of perl. IMHO learning to use it effectively is just as much perl hacking as fiddling with a complicated regex. I know because I still have deficiencies in that part.

Re: Is using Catalyst cheating?
by shoness (Friar) on Jul 24, 2008 at 05:51 UTC
    You have clearly already learned the Perl motto "TMTOWTDI" (There's more than one way to do it!)

    Next is the traditional and important lesson from Larry Wall, Randal Schwartz, and Tom Christiansen regarding the virtues of a great programmer; laziness, impatience and hubris.

    :-)

    Get more done, create fewer bugs, and write less code! Win!

Re: Is using Catalyst cheating?
by polettix (Vicar) on Jul 24, 2008 at 07:05 UTC
    Why are you so concentrated on learning Perl that you disregard learning to use other tools as something valuable? You learnt about the MVC, you learnt about schemas, you learnt how to use Catalyst - all these things will probably be more useful than knowing the guru tricks the next time you want to put up some web interface.

    Not that the guru tricks aren't important, or that knowing how map works has no value. But you had the wonderful occasion to learn valuable information and tools "hands-on", so I'd call this a success (learning-wise).

    Last, but not least, you learnt about one of the most important parts of Perl: the Community. So, your knowledge of the language is possibly lower, but your knowledge of Perl is surely much higher.

    perl -ple'$_=reverse' <<<ti.xittelop@oivalf

    Io ho capito... ma tu che hai detto?
Re: Is using Catalyst cheating?
by talexb (Chancellor) on Jul 24, 2008 at 14:41 UTC
      Is working with catalyst good or bad for my perl education?

    Excellent question.

    The answer is that it's definitely good for your Perl education. Developing in Perl isn't limited to just writing your own little scripts to do Some Neat Thing (I've written half a dozen new ones, all very useful, in the last six months). It also involves using Perl modules that work together to fill a business need. I've used Template Toolkit, DBI, CGI::Application and piles of others. I still get lots of chances to write Perl code when using those modules.

    In addition, as you use Catalyst, you'll hang out with the Catalyst community, get to know the fans and developers, trade tips, help each other and learn more. What's not to like? :)

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Re: Is using Catalyst cheating?
by educated_foo (Vicar) on Jul 24, 2008 at 16:40 UTC
    Perlmonks Orthodox answer: No.

    Honest answer: Catalyst pulls in many stupid, unnecessary dependencies (i.e. everything under Test::Pod, Test::Perl::Critic, and Test::Pod::Coverage for starters). You should consider whether it's worth dealing with this junk.

Re: Is using Catalyst cheating?
by talexb (Chancellor) on Jul 25, 2008 at 17:02 UTC

    To follow up on what brother educated_foo says above, trying to get an answer for "What's the best web framework?" makes about as much sense as asking "What's the best hatchback?" or "Which Linux distro is the best?" because there are too many variables for an accurate answer.

    However, if your choices are

    • Continue with your random disorganized assortment of CGIs (no offense ;) );
    • Write your own web framework from scratch; or
    • Use a web framework from CPAN,
    then most of us are recommending the third option. And it doesn't matter which one you choose -- install a couple, and if possible, test them out with a really, really simple web application. Try out the community support for your choices and make your own decision.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds