Re: Python vs PHP

From: JZ (z_at_b.com)
Date: 10/23/04


Date: Sat, 23 Oct 2004 01:09:23 +0200

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



Relevant Pages

  • Re: New template engine - retry
    ... is an improvement over Smarty (and the other, newer, template engines ... tell me why you think this template is better ... There are two central points where I believe mplate is different from ... other PHP template engines. ...
    (comp.lang.php)
  • Re: New template engine - retry
    ... is an improvement over Smarty (and the other, newer, template engines ... than other template systems. ... There are two central points where I believe mplate is different from ... other PHP template engines. ...
    (comp.lang.php)
  • Re: Feedback wanted: new PHP template engine
    ... What do you mean by method chaining? ... Somehow I'd like to keep a Smarty reference ... Personally i wouldn't use a name that references to Smarty because your template engine don't have that much similarities with Smarty (beside that your template engine using curly braces as delimiter and also compiles the templates into php code). ...
    (comp.lang.php)
  • Re: [PHP] Templates/Separate content from presentation
    ... > I've coded in PHP for a while, but I had to leave it for some time. ... I tried Smarty for several weeks and found it was more than I needed, ... Then in my php scripts I call a template like this: ... Of course I have no template caching system like Smarty has, ...
    (php.general)
  • Re: Python vs PHP
    ... I am using Smarty and I know them very well, but compiled Cheetah Templates ... indyvidual placeholder or portions of template. ... Cheetah can be extended using inheritance ...
    (comp.lang.python)