Python vs PHP

JZ z at b.com
Fri Oct 22 19:09:23 EDT 2004


Dnia Fri, 22 Oct 2004 14:22:53 -0700, Cliff Wells napisał(a):

> First of all, more powerful wasn't the main criteria and easier to use
> is arguable depending on your point of view.

Hmm, so what's the main criteria? :)

> Smarty strikes a fine balance between power and simplicity.  

It is your personal point of view. Many others consider Smarty for hard to
learn and much too complicated for template system which should be simple
and easy to learn. PHP is itself a template language, so someone could say
there is no need for another template language on top of it. :) Look at
Savant Template System http://phpsavant.com/yawiki/. There are interesting
user notes. Many people seems to be frustrated with Smarty syntax.

But my personal point of view is, that Smarty is the best PHP template
system and it is worth to learn it even if it is not as simple as someone
could expect. I have no problem with Smarty's syntax because I use it for
several years. And if I would have to use PHP I would choose Smarty.

But, the problem is PHP itself has so many bad features that I prefer
rather Python to PHP. And I like Cheetah's inheritence aproach because it
is scales very well for complicated web pages. I can develop internet
application much faster using Python (e.g. using application, very cool and
pythonic Cherry2) and Cheetah. And because extending templates using OO
techniques is tthe feature I like, I would rather choose Cheetach than ZPT,
SimleTAL, Nevow and similar solutions.

> This is where I feel most of the Python templating engines fall down.  
> They try to do too much.

It is not fair to compare one Smarty against several anonymous template
systems for Python. I compare Smarty with Cheetah. Not Cheetah against
PHPLib, and all other better or worse templates for PHP.

> Smarty [...] provides a way to extend itself with custom functions,

Savant Templates provides custom plugins using only pure PHP without
another, strange language. :) Savant has markup compiler, so you can invent
any markup system you like.

> My personal feeling on templates is that if you find yourself needing
> very powerful features, you're doing it wrong.

No. I need power and simplicity working together. And my choice is Cheetah.
It has power and it is enough simple to be easy learned.

Regards,
Jarek http://zabiello.com



More information about the Python-list mailing list