[TYPO3-dev] Moving the topic of the discussion a little bit -- Based of thread "Change roadmap..."

Dimitri Tarassenko mitka at mitka.us
Wed Apr 12 20:08:19 CEST 2006


Michael,

On 4/12/06, Michael Scharkow <mscharkow at gmx.net> wrote:
> Dimitri Tarassenko wrote:

> > article. Otherwise, it's sometimes TOO tempting to just call a couple
> > of functions in the template when you really need to handle it in
> > business objects. Sounds familiar? ;).
> Yes it does, but I don't completely buy this argument because after all
> it's US who creates and maintains the logic *and* the presentation. So
> you can just try to be disciplined and not mix logic into the template.
> I think this is entirely possible without technical restrictions.

Well, thousands of code writers try every day to be disciplined and do
a free() for every malloc(), you see where I am going with this? :) It
is possible, but because of human nature it's not something that is
going to happen as oftes as it should.

> Moreover, in a normal MVC situation you would call a view template only
> with local (method) namespace available, so the 'risk' is quite low.

I maybe missed something in the example that was provided with the
article but isn't $GLOBALS[] going to be available anyway?

> The argument reminds me of the JAVA advocates who say: static typing and
> public/private properties force you to do write better code because you
> cannot use any shortcuts (like setting properties without accessor
> methods, or calling functions with wrong object types). The Python
> language does not have private/public properties, but only advocates the
> dev's discipline by naming private stuff __foo__. This works just as well.

Python is a bad example. Python has so many language-enforced style
restrictions that Java is nowhere near. I would start with the fact
that assignment operation does not return a value - if I remember this
right Guido argued that this was specifically done to get rid of if (
a=b ) vs. if (a==b) errors. And so on. Don't get me wrong, I actually
like Python for that.

> For this, I find PHP is the ideal solution because it offers
> maximal flexibility without any overhead.

Actually Smarty's overhead is about the same as pure PHP, because it
compiles the template into PHP files that are later executed, so we
are only talking about the overhead on the first run after modifying
the template.

> And anyone mixing business
> logic into our code will tarred and feathered ;)

Yeah right ;)))

--
Dimitri Tarassenko


More information about the TYPO3-dev mailing list