[Catalyst] template comparison (was: why not mason (was:
somethingelse unrelated))
Alan Humphrey
alan.humphrey at comcast.net
Fri Oct 27 18:28:15 GMT 2006
-----Original Message-----
From: Jonathan Rockway [mailto:jon at jrock.us]
Sent: Friday, October 27, 2006 11:03 AM
To: The elegant MVC web framework
Subject: [Catalyst] template comparison (was: why not mason (was:
somethingelse unrelated))
Max Afonov wrote:
> Why don't I _ever_ hear about Mason on this list? How is TT better than
> Mason anyway?
>
> ...not meaning to start a flame war...
Mostly because mason becomes an unreadable mess, just like PHP. Take a
look at the RT source code, or my clever example here:
Mason:
<table><% my $sth = $dbh->prepare('SELECT columns FROM table WHERE
something=1'); for($row = $sth->fetchrow_arrayref){ %></table>
TT (in Cat with DBIC):
<table>
[% WHILE (row = rows.next) %]
<tr>
<td>[% row.name | html %]</td><td>[% row.whatever | html %]</td>
</tr>
[% END %]
</table>
[Alan Humphrey] -------
c'mon now. Be fair in your comparisons. Wouldn't the Mason/Cat/DBIC
example look something like:
<table>
% while (my $row = $rows->next()) {
<tr>
<td><% $row->name %></td><td><% $row->whatever %></td>
</tr>
% }
</table>
I agree that Mason templates can become a mess, but they don't have to. And
there's something to be said for working in a language you know (Perl) in
lieu of learning another (TT).
More information about the Catalyst
mailing list