[imp] General: trashy style
Miroslaw Jaworski
mjaw@ipartners.pl
Fri, 18 Jan 2002 12:47:27 +0100
* Jan Schneider (jan@horde.org) [020118 12:30] wrote:
> Zitat von Miroslaw Jaworski <mjaw@ipartners.pl>:
>
> > Hi
> >
> > Is it really needed to have 3 concurrent ways of openings tags for
> > PHP code? ( <?php <? <?= ) ( Horde2/IMP3 )
> >
> > Many my collegues consider such "style" annoying.
> > Someone else thinks the same ?
>
> <? shouldn't be there. See docs/CODING_STANDARDS for details.
# find horde-2.0 -type f -exec fgrep "<? " {} \;
<?
<? if (isset($style)) { ?>
<? } ?>
Always use <?php ?> to delimit PHP code, not the <? ?> shorthand.
<form name="horde_login" method="post" action="<? Horde::pselfURL() ?>">
# find horde-2.0 -type f -exec fgrep -l "<? " {} \;
horde-2.0/admin/css/index.php
horde-2.0/docs/CODING_STANDARDS
horde-2.0/templates/login/login.inc
Ok, i can presume its mistake and will be fixed.
( noone noticed because everyone was forced to switch to php short tags,
when it's working ).
Anyway - it's just the proof that multiplying tags IS a trashy style :)
By using <?= site admins are forced to allow short tags.
At least until they do
find . -type f -exec perl -pi -e 's#<\?= #<?php echo #g' {} \;
As you can see: using full tags is compatible with ANY site policy
( our is to use full tags ), while short tags - not.
And using <?php for most of the codings dont change that until there
are <?= occurences ( who the hell "invented" it ?! - sure he didn't heard
about Ockham's Razor... )
Regards
MJ.
--
Miroslaw.Jaworski@ipartners.pl ( Psyborg ) MJ102-RIPE Internet Partners
Server Administration Department Manager