On Tue, 15 Oct 2002, Dan Hardiker wrote:

> >> I am still +1 on some how getting away from short_open_tag support, if
> >> nothing else, to encourage better coding practices (just as we did
> >> with turning register_globals off by default).
> >
> > I fail to see how using <?php is "better coding practices".  Unless you
> > plan on distributing your code to the masses or mixing XML/XHTML without
> > trivially escaping it, I see absolutely no point in using <?php over <?.
> 
> The web is a rapidly changing market and standards are being activley
> evolved. <?php is more compatable with standards on the web than <? ...
> and its not about XML document headers.

Who cares about standards? Nothing on the web adheres to them anyway? 

> 
> > In reality, very few people intermix PHP and XML.  It just doesn't make
> > a whole lot of sense to do so.  People tend to keep the two separate and
> > parse the XML from PHP.
> 
> I have written semi static XML document from php before (for speed reasons
> over using an output parser). EG:
> 
> <?xml ... ?>
> <root>
>   <data>
>     <age><?php echo $age; ?></age>
>   </data>
> </root>

.htaccess with_shorttags disabled.

> 
> > In the XHTML case, a lot of people mistakenly believe that they must
> > start their documents with an <?xml encoding=...?> tag, which if you
> > read the XHTML spec, is actually not necessary. The only use for the XML
> > encoding tag is for XML parsers to get the right character encoding.
> > Browsers, which are typically the target of PHP generated pages, get
> > their character encoding from the Content-type header, or optionally
> > from a similar meta tag. But even if you choose to put in the XML
> > encoding tag, I find it a hell of a lot easier to just put <?echo '<?xml
> > encoding="foobar"?>'?> at the top instead of changing hundreds of <?
> > tags to <?php
> 
> The other advantage is to force people one way or the other. In the case
> of 50% of servers allowing short tags, and the other not... a script using
> short tags will only work on 50% of PHP installations (just as a script
> that relies on register_globals will only work on servers with it switched
> on).
> 
> The only way around that problem is:
>  1. to force short tags on everywhere
>  2. to force people to use a tagging which is available everywhere

Forcing people doesn't work, and why would we? It only annoys users, 
which will annoy us again with their silly bugreports. Silly bugreports 
waste time, and time is not something that a lot of people have.

Now please get over this, it will not change.


Derick


--

---------------------------------------------------------------------------
 Derick Rethans                                   http://derickrethans.nl/ 
 JDI Media Solutions
--------------[ if you hold a unix shell to your ear, do you hear the c? ]-



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to