>> and the problem with that, is you're not paring tons of html through a
>> search-replace function, which also created unnecessary overheead, and
> 
> You have a point here. Template-systems are slow.

yeppers...

that's why I didn't implement one of those keyword things in binarycloud.
ergh.

>> forces you (once again) to make a spec that says "here's how this template
>> system works)
> 
> There are "standard"-template-systems like FastTemplates or PHPLIB templates.

that's true.

>> part of the point was for _PHP_ to be embedded html, in my opinion your
> 
> It was created that way. It still is possible. Is can be quite handy,
> sometimes (or often, depends on what you do). That doesn't mean you have to
> use it.

I'm not implying that there are rules etched in stone somewhere, but I am
trying to prove a point, because I see many people making the "echo"
mistake, which makes their otherwise great code much less useful.

>> example above takes the "don't mix logic with markup" much too far:
> 
> I don't think I crossed a border here. When execution-speed doesn't matter
> that much (wich often is the case), there is only one rule: Get it done as
> fast and reusable as possible.

Ok, execution speed does matter to me. I run webserver installations, and
anything over about 2 tenths of a second starts to get annoying when you
send a lot of users to a site.

> Code that uses templates tends to be very reusable, at least it is VERY easy
> to change the design.
> And if the design is done by a designer who doesn't know PHP, it may also be
> done faster.

The code I have to maintain (single-handedly when it comes to html) for even
very large stuff inside of binarycloud is pretty simple.

One of the core team is actually working on a feature for form builder that
will further simplify the markup files.

>> <input type="text" name="hello" size="20" value="<?=$value?>">
>> 
>> is really not that much harder to write.
> 
> With a HTML-editor? It probably would HTML-encode this, so you end up with
> &lt;=$value&gt;

Maybe if you have a badang-crap html editor :) Try using emacs, BBEdit,
HomeSite, or any of the other quality editors out there.

I don't think that's a consideration.

>> html people can ignore it,
> 
> almost

yes, come on.

>> php can find their code, and those that know
>> both can reap the benefits.
>> 
>> what about loops?
> 
> Templates can do loops, with so called "blocks".
> Your system can't. Not whithout mixing PHP and HTML in a way that will make a
> designer throw hardware at you.

eh?

my system does loops with php code.

it is very important to note that that code need not be embeddedin the same
file as the markup.

for example, I need a "style" for an individual record coming out of a
database. so I make that html, put a little function "tag" around it"

<? fucntion hello($stuff) { ?>
<font color="#999999"><b><?=$stuff?></b></font>
<? } ?>

That is an intentionally simplistic example, but you can obviously see that
if a php coder tells the html coder "that bit of html is going to be looped
for as many records as we get out of the database - they html coder should
think accordingly.

After all, we really aren't talking about "rocket science".

>> etc...
>> 
>> you start building your own little template language constructs, which is
>> dumb because php already has them!
> 
> There are clean (but slow) template-solutions out there. Maybe this will
> change some day.

This is true - some of the parsed-template systems use nicely clean code.
But they cost cpu cycles, bigtime. And, ok, hardware is commodity, but you
can actually do more cool things if you use simple php in html, with
controlling logic.

> Anyway, from a designers point of view, your system is far messier
> (especially with loops) than templates. But faster, both for you to write and
> to execute for PHP. Well, this is a world of tradeoffs.

Absolutely not.

under my system, we don't end u splitting html into billions of little
chunks, we make a "page" of html which is associated with a piece of
controlling logic in a separate file, then insert discreet function "tags"
which allows the controlling logic to do its stuff.

_alex


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to