[oak perl] Requests for Advise: Perl CGI or PHP?

Eugene eugene at metaart.org
Fri Dec 2 17:45:47 PST 2005


Hi Zed,
Thanks once more.
I'll keep that in mind.
Eugene

------------------------------------------------
On Friday 02 December 2005 15:15, Zed Lopez wrote:
> I'd say no. Once you know HTML::Template (and it works well with
> CGI::Application for lightweight dynamic sites) -- and neither is hard
> to learn -- your overall lines of code+HTML will be shorter, easier to
> read, easier to modify, and faster to write.
>
> Not doing it would be what the Camel Book calls false laziness.
>
> Doing thorough research of all the frameworks and using something like
> Maypole might be overkill for a simple personal site.
>
> Another bonus of this separation is that it facilitates moving the
> system to a different framework, 'cause all of their separations are
> fairly similar. If you've written a mass of mixed HTML & code there's
> nothing for it but to start over.
>
> On 12/2/05, Eugene <eugene at metaart.org> wrote:
> > Hi Zed,
> > Thanks for even more input.
> >
> > I see your point.
> > However, I wonder if this isn't overkill
> > for a simple personal site.
> >
> > Eugene
> >
> > On Friday 02 December 2005 10:51, Zed Lopez wrote:
> > > If you're working in Perl, check out Template Toolkit or
> > > HTML::Template (the latter is probably a better idea if you're without
> > > mod_perl -- TT is pretty hefty.)
> > >
> > > That way you're neither putting (Perl) code in HTML or HTML in code.
> > >
> > > Most web programmers (including me) will tell you that you're doomed
> > > if you don't use a model-view-controller framework in which you
> > > separate the presentation code (view), the navigation &
> > > user/permissions/session management code (controller), and the
> > > application logic (model). Using a template system enforces the
> > > separation of view from everything else to a large degree -- it
> > > becomes more difficult to intermix things in a bad way, so it acts as
> > > an implicit reminder not to.
> > >
> > > It's not that you can't have a good separation with Perl mixed with
> > > HTML (Mason is one popular Perl web programming framework that does
> > > just this), but it makes it easy to violate the separation without
> > > even necessarily noticing you do so.
> > >
> > > And it's not that I favor systems that hamstring you in an effort to
> > > enforce good coding practices (I can rant at length at how tedious and
> > > annoying I find Python, where that was a major design consideration),
> > > it's that I haven't felt hamstrung in good template systems -- they do
> > > a lot for you.
> > >
> > > Of course, I've been out of web programming in Perl for over a year
> > > and there could be some latest, greatest thing I've never heard of.
> > > I'd be sure to do some research and to check out CGI::Prototype,
> > > Maypole and Catalyst, for starters if I were to embark on some more.
> > > (These are more controllers than template engines, or they were last I
> > > looked.)
> > >
> > > Perlmonks.org is a good place to search for info on this (or related
> > > matters) -- you get a lot of commentary on things from people who've
> > > been in the trenches.




More information about the Oakland mailing list