[Catalyst] Anyone with PHP / Smarty Background
Christopher Heschong
chris at wiw.org
Fri Dec 29 04:50:14 GMT 2006
Hi Brian, I spent years as a successful PHP programmer with some
pretty complicated apps out there. I've found that with Catalyst I
can write much cleaner code in a few lines that do what I used to do
with pages and pages of PHP. Plus, with Perl you get all the great
libraries from CPAN available to you.
Stability is great, I've handled hundreds of thousands of hits in a
day with no issues (mod_perl). I haven't had any problems with
speed, although I would say that raw PHP is probably faster if you
were to benchmark it on simple things.
The things to get used to are:
- The MVC pattern isn't how most PHP apps are constructed. It takes
some major getting used to, but is worth it in the long run.
- Everything is Object Oriented (or should be) in Catalyst. This is
a big shift if you haven't been living that life in PHP. Database
access is nicer with things like DBIx::Class or Class::DBI, but
different somewhat than what you may be used to. Ends up being more
elegant, imho.
- If you're using mod_perl on Apache it takes a while to get used to
the fact that you can't just copy some files into some directory
somewhere, you have to actually *install* (or add the libs to your
path). This is more of a PHP vs Perl thing, and maybe fastcgi
addresses this.
- Mapping URLs to actions and subroutines in Catalyst is SO EASY,
it's like falling down. Grabbing stuff from the database is SO
EASY. Session management is SO EASY, etc. You'll end up wondering
how your apps got so small and took such a short time to create.
Template Toolkit (TT) has a lot of the same feel as Smarty. Instead of:
{$something}
You would write:
[% something %]
Also, TT allows plugins like Smarty does, so extending it is pretty
easy to do if you like that.
On Dec 28, 2006, at 10:12 PM, Brian wrote:
> Hi,
>
> I've been programming in PHP for about 6 years, and using the
> Smarty template engine for about 3 years, so I've gotten pretty
> proficient at them.
>
> I can see the need for something like Catalyst or Ruby on Rails,
> but it's a big shift.
>
> Anyone here with a background in PHP / Smarty that can share their
> perspective and whether the switch has been worth it?
>
> How does the speed and stability compare? Can you develop faster
> in Catalyst than you could in PHP / Smarty?
>
> Thanks!
> Brian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2409 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20061228/42f9427a/smime.bin
More information about the Catalyst
mailing list