Reply to Re: Coding style...

Your name:

Reply:


Posted by Curtis on 01/02/06 22:49

J.O. Aho <user@example.net> wrote in message
news:41t3tcF1gctppU1@individual.net...
> Curtis wrote:
>
> > <?php
> > global $user;
> > if ($user->uid) {?> <li><a href="logout" title="">Log
> > Out</a></li>
> > <?php } else {?> <li><a href="user/login" title="">Log
> > In</a></li>
> > <?php }?>
> >
> > Ten characters in order to type that closing brace? Wow.
>
> This generates less work for PHP than what
>
> <?PHP
> if ($user->uid) {
> echo "<li><a href=\"logout\" title=\"\">Log
Out</a></li>";
> } else {
> echo "<li><a href=\"login\" title=\"\">Log In</a></li>";
> }
> ?>

That was all I could think of, J.O.

I'm not sure the tradeoff is anywhere near worth it, though.
Better more work for PHP, I'd think, that be driven crazy as
a code maintainer trying to read the mixed PHP-MTML soup.

I suspect that on most sites the speed improvement, if any,
would be marginal. I can't speak from much experience, but
in the project I'm working on--a text filter--the text
processing done by PHP scanning text twenty-plus times and
substituting this for that would probably dwarf the output
of a little HTML as PHP strings.

--

Curtis

Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.
>
>
> file://Aho

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация