Re: [PHP] Re: PHP in HTML code

2010-03-19 Thread Peter Lind
On 19 March 2010 10:17, Michael A. Peters  wrote:
>
> I don't care what people do in their code.
> I do not like released code with short tags, it has caused me problems when
> trying to run php webapps that use short tags, I have to go through the code
> and change them.
>
> So what people do with their private code, I could care less about.
> But if releasing php code for public consumption, I guess I'm a preacher
> asking people to get religion, because short tags do not belong in projects
> that are released to the public. Just like addslashes and magic quotes and
> most html entities should not be used in php code released for public
> consumption.
>

What he said. Now, could we get over this discussion? It's not exactly
going anywhere.

-- 

WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-19 Thread Michael A. Peters

Jan G.B. wrote:

2010/3/18 tedd :

Calling it "ranting" or "religious" unjustly demeans the discussion and is
inflammatory.
In all of this, I've simply said it's your choice.


What I said was:
*persons ranting about short open tags* *are just like some religious people
*


I don't care what people do in their code.
I do not like released code with short tags, it has caused me problems 
when trying to run php webapps that use short tags, I have to go through 
the code and change them.


So what people do with their private code, I could care less about.
But if releasing php code for public consumption, I guess I'm a preacher 
asking people to get religion, because short tags do not belong in 
projects that are released to the public. Just like addslashes and magic 
quotes and most html entities should not be used in php code released 
for public consumption.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Adam Richardson
On Thu, Mar 18, 2010 at 1:37 PM, Ashley Sheridan
wrote:

> On Thu, 2010-03-18 at 18:37 +0100, Jan G.B. wrote:
>
> >
> >
> > 2010/3/18 Ashley Sheridan 
> >
> >
> > On Thu, 2010-03-18 at 18:09 +0100, Jan G.B. wrote:
> >
> > > 2010/3/18 Ashley Sheridan 
> > >
> > > >  I'd rather have short tags turned off than remember each
> time that I have
> > > > to keep breaking up the < and ?php before I output it in-case
> the parser
> > > > gets confused.
> > > >
> > >
> > > You don't need to break anything up. It's perfectly valid and
> without
> > > problems:
> > >
> > > '; ?>
> >
> >
> >
> >
> > What about this:
> >
> > 
> >  >
> >
> >
> >
> >
> > It's confusing! =)
> >
> >
> > That would break with short tags turned on. I often use this
> > sort of code in my Ajax server stuff. I don't want to have to
> > use PHP to echo out what would work on a normal setup.
> >
> >
> > I can understand it. But I think it's nonsense to output one line of
> > "text" (prolog) and then start with  > first line of PHP should not be an echo. Where's the point?
> >
> >
> >
> >
> >
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
> >
> >
> >
> >
> >
>
>
> That was just a really small example. Imagine the  other lines of actual XML content that might remain static:
>
> 
> 
>
>
>// code that changes here
>?>
> 
>
> I could use heredoc or nowdoc, but why that's just ugly, and the
> resulting XML inside the heredoc/nowdoc isn't recognised as XML by any
> editor I know of. All of that to avoid writing a few extra characters to
> "save myself some work"...
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>

   - 310 characters.
   - Differentiation between code that's merely echoed and code that
   performs some operation.
   - XML is recognized by editors.
   - Easier for me to visually scan.

' ?>

   
   
  
  
  
  
  
   
   





   - 340 characters.
   - All code blocks consistent.
   - XML recognized by editors.




   
   
  
  
  
  
  
   
   


Given the choice, I'd rather work with the first option, but I have no
problem with those who prefer the second option.

Adam

-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Ashley Sheridan
On Thu, 2010-03-18 at 18:37 +0100, Jan G.B. wrote:

> 
> 
> 2010/3/18 Ashley Sheridan 
> 
> 
> On Thu, 2010-03-18 at 18:09 +0100, Jan G.B. wrote: 
> 
> > 2010/3/18 Ashley Sheridan 
> > 
> > >  I'd rather have short tags turned off than remember each time 
> that I have
> > > to keep breaking up the < and ?php before I output it in-case the 
> parser
> > > gets confused.
> > >
> > 
> > You don't need to break anything up. It's perfectly valid and 
> without
> > problems:
> > 
> > '; ?>
> 
> 
> 
> 
> What about this:
> 
> 
>  
> 
> 
> 
> 
> It's confusing! =)
> 
>  
> That would break with short tags turned on. I often use this
> sort of code in my Ajax server stuff. I don't want to have to
> use PHP to echo out what would work on a normal setup.
> 
> 
> I can understand it. But I think it's nonsense to output one line of
> "text" (prolog) and then start with  first line of PHP should not be an echo. Where's the point?
> 
> 
> 
> 
> 
> 
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
> 
> 
> 
> 
> 


That was just a really small example. Imagine the 






I could use heredoc or nowdoc, but why that's just ugly, and the
resulting XML inside the heredoc/nowdoc isn't recognised as XML by any
editor I know of. All of that to avoid writing a few extra characters to
"save myself some work"...

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Jan G.B.
2010/3/18 Ashley Sheridan 

>  On Thu, 2010-03-18 at 18:09 +0100, Jan G.B. wrote:
>
> 2010/3/18 Ashley Sheridan 
>
> >  I'd rather have short tags turned off than remember each time that I have
> > to keep breaking up the < and ?php before I output it in-case the parser
> > gets confused.
> >
>
> You don't need to break anything up. It's perfectly valid and without
> problems:
>
> '; ?>
>
>
> What about this:
>
> 
> 
>
It's confusing! =)


> That would break with short tags turned on. I often use this sort of code
> in my Ajax server stuff. I don't want to have to use PHP to echo out what
> would work on a normal setup.
>

I can understand it. But I think it's nonsense to output one line of "text"
(prolog) and then start with 
>   Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>


Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Ashley Sheridan
On Thu, 2010-03-18 at 18:09 +0100, Jan G.B. wrote:

> 2010/3/18 Ashley Sheridan 
> 
> >  I'd rather have short tags turned off than remember each time that I have
> > to keep breaking up the < and ?php before I output it in-case the parser
> > gets confused.
> >
> 
> You don't need to break anything up. It's perfectly valid and without
> problems:
> 
> '; ?>


What about this:


http://www.ashleysheridan.co.uk




Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Jan G.B.
2010/3/18 Ashley Sheridan 

>  I'd rather have short tags turned off than remember each time that I have
> to keep breaking up the < and ?php before I output it in-case the parser
> gets confused.
>

You don't need to break anything up. It's perfectly valid and without
problems:

'; ?>


Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Adam Richardson
On Thu, Mar 18, 2010 at 11:28 AM, tedd  wrote:

> At 9:34 AM + 3/18/10, Pete Ford wrote:
>
>>
>> I do tend to use > camp here.
>>
>
>
> Whoa, that's even worse -- make a choice and stick with it -- IMO.
>
> I'm all for consistency and have often found myself redoing dozens of
> scripts because I changed something -- not because the change worked and the
> other didn't, but rather to maintain consistency throughout the project.
>
> Granted, different reasons promote different programming styles. While what
> I do is to solve the problem at hand for the client, it also has to pass
> through my vision of code elegance. I program for myself first and solve the
> client's problems second. I also realize that I have the privilege of doing
> so because my needs are few. I probably wouldn't do well in a production
> oriented environment.
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

What Pete described is consistent.

For blocks that merely echo out a variable in templates or views, he uses a
http://nephtaliproject.com


Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Ashley Sheridan
On Thu, 2010-03-18 at 17:57 +0100, Jan G.B. wrote:

> Sure - XML is often used and served. But in general, a web server only
> parses PHP-Files (ie. .+\.php\d?) unless you configure your server to
> parse any file or .xml files. So the XML  for the interpreter.


I wasn't meaning that xml files would be parsed as PHP, but that PHP
would be used to output XML. I'd rather have short tags turned off than
remember each time that I have to keep breaking up the < and ?php before
I output it in-case the parser gets confused.

Templating is great, but it's not for all projects.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Jan G.B.
2010/3/18 Ashley Sheridan 

> Technically, PHP isn't embedded in any language; it's the other way around.
>
> XML and PHP are used together more often than you might realise. Consider
> Ajax and RSS, which are becoming more and more popular. Also, there are
> sites out there that are almost entirely XML-based; just have a look at the
> World of Warcraft (yes I play it!) website.
>
> Sure - XML is often used and served.
But in general, a web server only parses PHP-Files (ie. .+\.php\d?) unless
you configure your server to parse any file or .xml files. So the XML  For me, I originally learnt PHP using the  about short tags when I first ran into the problem with them on shared
> hosting that had them turned off. To me, it didn't make much sense in using
> something that wasn't portable. For the same reason, I try to avoid using
> obscure PHP modules when I know a system will end up on a closed hosting
> platform like this.
>
>
My opinion to this is that I seperate markup from code. I use a template
system in my .tpl files and these will never get parsed. Inline PHP is not
my choice.
But when I'm about to update a project that is written with inline php, I
appreciate the short tags for their ease of use. I also enjoy typing less.
:-)

Regards


Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Ashley Sheridan
On Thu, 2010-03-18 at 17:32 +0100, Jan G.B. wrote:

> 2010/3/18 tedd :
> > Calling it "ranting" or "religious" unjustly demeans the discussion and is
> > inflammatory.
> > In all of this, I've simply said it's your choice.
> 
> What I said was:
> *persons ranting about short open tags* *are just like some religious people
> *
> 
> I did not address you.
> 
> On the other hand you're telling people here that their approach is "worse"
> and yours is great. IMHO this isn't a discussion but bashing without any
> reasoning.
> You simply say that XML is confused by a short open tag, but actually PHP is
> not embedded in XML.
> 
> I quote you:
> > that's your choice -- but your decision is also a demonstration to your
> client/employer/peers as to your desire to produce the "best" possible code.
> > I look at code containing " tables and embedded styling for presentation -- "This must be old code OR
> the programmer still doesn't get it".
> 
> You make it very clear that you believe in your superior coding style.


Technically, PHP isn't embedded in any language; it's the other way
around.

XML and PHP are used together more often than you might realise.
Consider Ajax and RSS, which are becoming more and more popular. Also,
there are sites out there that are almost entirely XML-based; just have
a look at the World of Warcraft (yes I play it!) website.

For me, I originally learnt PHP using the http://www.ashleysheridan.co.uk




Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Jan G.B.
2010/3/18 tedd :
> Calling it "ranting" or "religious" unjustly demeans the discussion and is
> inflammatory.
> In all of this, I've simply said it's your choice.

What I said was:
*persons ranting about short open tags* *are just like some religious people
*

I did not address you.

On the other hand you're telling people here that their approach is "worse"
and yours is great. IMHO this isn't a discussion but bashing without any
reasoning.
You simply say that XML is confused by a short open tag, but actually PHP is
not embedded in XML.

I quote you:
> that's your choice -- but your decision is also a demonstration to your
client/employer/peers as to your desire to produce the "best" possible code.
> I look at code containing "

Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread tedd

At 4:11 PM +0100 3/18/10, Jan G.B. wrote:

I agree.
And I believe the persons ranting about short open tags are just like
some religious people. It's almost like a war between
Linux/Windows/Mac, IE/FF or ASP/PHP.
Also, people love to recommend things that others recommended before.
It mustn't make a big sense.


Calling it "ranting" or "religious" unjustly demeans the discussion 
and is inflammatory.


In all of this, I've simply said it's your choice. While I "believe" 
and have stated my reasons, which are more than "faith", you are free 
to do whatever you want. I don't consider any of this discussion (on 
either side of the argument) as "religious' or "ranting" -- it's 
simply a discussion.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread tedd

At 9:34 AM + 3/18/10, Pete Ford wrote:


I do tend to use middle camp here.



Whoa, that's even worse -- make a choice and stick with it -- IMO.

I'm all for consistency and have often found myself redoing dozens of 
scripts because I changed something -- not because the change worked 
and the other didn't, but rather to maintain consistency throughout 
the project.


Granted, different reasons promote different programming styles. 
While what I do is to solve the problem at hand for the client, it 
also has to pass through my vision of code elegance. I program for 
myself first and solve the client's problems second. I also realize 
that I have the privilege of doing so because my needs are few. I 
probably wouldn't do well in a production oriented environment.


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Jan G.B.
2010/3/18 Pete Ford :
> On 17/03/10 18:59, Tommy Pham wrote:
>>
>> On Wed, Mar 17, 2010 at 11:01 AM, Rene Veerman  wrote:
>>>
>>> hmm.. seems easier to me to push a filetree of .php's with>> the str_replace(), than it is to get all the>> with your wishes, which may not apply to their situation ;-)
>>>
>>> On Wed, Mar 17, 2010 at 5:14 PM, tedd  wrote:

 At 8:55 PM -0400 3/16/10, Adam Richardson wrote:
>
> That said, I'm not taking exception with those who don't use the short
> tag, only with those who say I shouldn't.

 Exception or not, it's still your choice and using short tags can cause
 problems.

 My view, why create problems when there is a solution? Forcing the issue
 is
 a bit like "I'm going to do it my way regardless!" I've traveled that
 path
 too many times in my life. Sometimes it's easier to take the path most
 traveled.

 Cheers,

 ted
 --
 ---
 http://sperling.com  http://ancientstones.com  http://earthstones.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>> http://www.php.net/manual/en/language.basic-syntax.phpmode.php
>>
>> "There are four different pairs of opening and closing tags which can
>> be used in PHP. Two of those,  and
>> , are always available. The other two are short tags and ASP
>> style tags, and can be turned on and off from the php.ini
>> configuration file. As such, while some people find short tags and ASP
>> style tags convenient, they are less portable, and generally not
>> recommended. "
>
> But the implication there is that they are *only* non-portable *because*
> they can be switched off - there's no other strong reason. Before anyone
> jumps in with XML / XHTML arguments again, those issues are fairly rare and
> very easily worked around. My projects tend to use XHTML doctype because it
> makes IE7/8 behave more predictably without a  block, and I always
> use short tags for  where I generate XML from a PHP script, there are workarounds for the  problem.
> I do tend to use  camp here.
> I also write code to be hosted on dedicated systems that I have full control
> over, so php.ini settings are always in my control (so far...)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I agree.
And I believe the persons ranting about short open tags are just like
some religious people. It's almost like a war between
Linux/Windows/Mac, IE/FF or ASP/PHP.
Also, people love to recommend things that others recommended before.
It mustn't make a big sense.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-18 Thread Pete Ford

On 17/03/10 18:59, Tommy Pham wrote:

On Wed, Mar 17, 2010 at 11:01 AM, Rene Veerman  wrote:

hmm.. seems easier to me to push a filetree of .php's with  wrote:

At 8:55 PM -0400 3/16/10, Adam Richardson wrote:


That said, I'm not taking exception with those who don't use the short
tag, only with those who say I shouldn't.


Exception or not, it's still your choice and using short tags can cause
problems.

My view, why create problems when there is a solution? Forcing the issue is
a bit like "I'm going to do it my way regardless!" I've traveled that path
too many times in my life. Sometimes it's easier to take the path most
traveled.

Cheers,

ted
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




http://www.php.net/manual/en/language.basic-syntax.phpmode.php

"There are four different pairs of opening and closing tags which can
be used in PHP. Two of those,  and
, are always available. The other two are short tags and ASP
style tags, and can be turned on and off from the php.ini
configuration file. As such, while some people find short tags and ASP
style tags convenient, they are less portable, and generally not
recommended. "


But the implication there is that they are *only* non-portable *because* they 
can be switched off - there's no other strong reason. Before anyone jumps in 
with XML / XHTML arguments again, those issues are fairly rare and very easily 
worked around. My projects tend to use XHTML doctype because it makes IE7/8 
behave more predictably without a  block, and I always use short tags 
for XML from a PHP script, there are workarounds for the 
I do tend to use I also write code to be hosted on dedicated systems that I have full control 
over, so php.ini settings are always in my control (so far...)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-17 Thread tedd

At 11:59 AM -0700 3/17/10, Tommy Pham wrote:

http://www.php.net/manual/en/language.basic-syntax.phpmode.php

"There are four different pairs of opening and closing tags which can
be used in PHP. Two of those,  and 
, are always available. The other two are short tags and ASP
style tags, and can be turned on and off from the php.ini
configuration file. As such, while some people find short tags and ASP
style tags convenient, they are less portable, and generally not
recommended. "


+1

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-17 Thread Tommy Pham
On Wed, Mar 17, 2010 at 11:01 AM, Rene Veerman  wrote:
> hmm.. seems easier to me to push a filetree of .php's with  the str_replace(), than it is to get all the  with your wishes, which may not apply to their situation ;-)
>
> On Wed, Mar 17, 2010 at 5:14 PM, tedd  wrote:
>> At 8:55 PM -0400 3/16/10, Adam Richardson wrote:
>>>
>>> That said, I'm not taking exception with those who don't use the short
>>> tag, only with those who say I shouldn't.
>>
>> Exception or not, it's still your choice and using short tags can cause
>> problems.
>>
>> My view, why create problems when there is a solution? Forcing the issue is
>> a bit like "I'm going to do it my way regardless!" I've traveled that path
>> too many times in my life. Sometimes it's easier to take the path most
>> traveled.
>>
>> Cheers,
>>
>> ted
>> --
>> ---
>> http://sperling.com  http://ancientstones.com  http://earthstones.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

http://www.php.net/manual/en/language.basic-syntax.phpmode.php

"There are four different pairs of opening and closing tags which can
be used in PHP. Two of those,  and 
, are always available. The other two are short tags and ASP
style tags, and can be turned on and off from the php.ini
configuration file. As such, while some people find short tags and ASP
style tags convenient, they are less portable, and generally not
recommended. "

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-17 Thread Rene Veerman
hmm.. seems easier to me to push a filetree of .php's with  wrote:
> At 8:55 PM -0400 3/16/10, Adam Richardson wrote:
>>
>> That said, I'm not taking exception with those who don't use the short
>> tag, only with those who say I shouldn't.
>
> Exception or not, it's still your choice and using short tags can cause
> problems.
>
> My view, why create problems when there is a solution? Forcing the issue is
> a bit like "I'm going to do it my way regardless!" I've traveled that path
> too many times in my life. Sometimes it's easier to take the path most
> traveled.
>
> Cheers,
>
> ted
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-17 Thread tedd

At 8:55 PM -0400 3/16/10, Adam Richardson wrote:
That said, I'm not taking exception with those who don't use the 
short tag, only with those who say I shouldn't.


Exception or not, it's still your choice and using short tags can 
cause problems.


My view, why create problems when there is a solution? Forcing the 
issue is a bit like "I'm going to do it my way regardless!" I've 
traveled that path too many times in my life. Sometimes it's easier 
to take the path most traveled.


Cheers,

ted
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-16 Thread Adam Richardson
On Tue, Mar 16, 2010 at 7:06 PM, Ashley Sheridan
wrote:

> On Tue, 2010-03-16 at 23:42 +0100, Rene Veerman wrote:
>
> > maybe adding a  > then deprecating  >
> > On Tue, Mar 16, 2010 at 7:18 PM, tedd  wrote:
> > > At 5:54 PM + 3/15/10, Jochem Maas wrote:
> > >>
> > >> Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> > >>>
> > >>>  First of all, i recommend the use of normal php tags ()
> > >>> because
> > >>>  the short tags are atm marked as* **DEPRECATED*.
> > >>
> > >> that's a documentation error.
> > >>
> > >>>
> > >>>  You should also echo your values to the page, instead using the
> shortcut
> > >>>  > >>>  (stop being a lazy ass! :P):
> > >>
> > >> it's not lazy, it's succinct and much easier to read (once you know
> what
> > >> it means),
> > >
> > > Yes, but like all web languages, they don't live in a vacuum -- they
> must
> > > play well with others to survive. Programming is dynamic not static.
> > >
> > > While using " others"
> > > and therein lies the problem. If XML (and possibility others) don't
> accept
> > > the short term tag, then why use it?
> > >
> > > Using "Standards" like this help promote better communication between
> all
> > > languages -- what's wrong with that? Simply put, either communicate
> better
> > > or don't -- that's your choice -- but your decision is also a
> demonstration
> > > to your client/employer/peers as to your desire to produce the "best"
> > > possible code.
> > >
> > > I look at code containing " tables
> > > and embedded styling for presentation -- "This must be old code OR the
> > > programmer still doesn't get it".
> > >
> > > Cheers,
> > >
> > > tedd
> > >
> > > --
> > > ---
> > > http://sperling.com  http://ancientstones.com  http://earthstones.com
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >
>
>
> I think that would just add to an already confusing situation.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>
I'll confess that I work on ASP.Net just as much as PHP (If you must throw
tomatoes, make sure their really ripe so they don't hurt as much ;)  I
appreciate the different tags offered in ASP.Net, as they succinctly provide
some convenient capabilities (one version provides similar capabilites to
PHP's .)

I believe that although they're removing the ASP version of tags (e.g., <%
%>) from PHP 6, they're keeping the short tag option debated in this thread,
and I hope they do.

To say that using short tags is bad form seems quite strong.  Additionally,
saying that XML doesn't accept the syntax is also extreme.  It's not that
XML doesn't accept the short tag.  Actually, PHP's parser is confused by the
XML declaration.  When you work with generating an XML document with PHP, it
only takes one line of code to accommodate PHP's parser.  However, the vast
majority of the time I'm generating XHTML 1 (or now more and more XHTML 5),
and neither of these require the XML declaration for validation purposes.

Additionally, wanting to write less code to perform the same action isn't
necessarily an act of laziness.  Am I lazy for loving the that I can use
simple message passing capabilities in Scala or transactional memory in
Clojure to perform tasks in parallel as opposed to the olden days of dealing
with threads in Java?  When I can type less, maintain clarity, and perform
the same action, I consider it an act of beauty.

When you compare the code samples below, I find that I prefer the short tag
version or the last example when I'm reworking the XHTML, as there's less
code to sift through.  There seems to be a trend in other templating
languages to shorten the amount of typing (e.g., Google Go uses
http://json-template.googlecode.com/svn/trunk/doc/Introducing-JSON-Template.html),
and I hope PHP will continue to keep pace with the trend, too.  That said,
I'm not taking exception with those who don't use the short tag, only with
those who say I shouldn't.

Adam


















{title}

{description}
{date}




-- 
Nephtali:  PHP web framework that functions beautifully
http://nephtaliproject.com


Re: [PHP] Re: PHP in HTML code

2010-03-16 Thread Ashley Sheridan
On Tue, 2010-03-16 at 23:42 +0100, Rene Veerman wrote:

> maybe adding a  then deprecating  
> On Tue, Mar 16, 2010 at 7:18 PM, tedd  wrote:
> > At 5:54 PM + 3/15/10, Jochem Maas wrote:
> >>
> >> Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> >>>
> >>>  First of all, i recommend the use of normal php tags ()
> >>> because
> >>>  the short tags are atm marked as* **DEPRECATED*.
> >>
> >> that's a documentation error.
> >>
> >>>
> >>>  You should also echo your values to the page, instead using the shortcut
> >>>  >>>  (stop being a lazy ass! :P):
> >>
> >> it's not lazy, it's succinct and much easier to read (once you know what
> >> it means),
> >
> > Yes, but like all web languages, they don't live in a vacuum -- they must
> > play well with others to survive. Programming is dynamic not static.
> >
> > While using " > and therein lies the problem. If XML (and possibility others) don't accept
> > the short term tag, then why use it?
> >
> > Using "Standards" like this help promote better communication between all
> > languages -- what's wrong with that? Simply put, either communicate better
> > or don't -- that's your choice -- but your decision is also a demonstration
> > to your client/employer/peers as to your desire to produce the "best"
> > possible code.
> >
> > I look at code containing " > and embedded styling for presentation -- "This must be old code OR the
> > programmer still doesn't get it".
> >
> > Cheers,
> >
> > tedd
> >
> > --
> > ---
> > http://sperling.com  http://ancientstones.com  http://earthstones.com
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 


I think that would just add to an already confusing situation.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Re: PHP in HTML code

2010-03-16 Thread Rene Veerman
maybe adding a  wrote:
> At 5:54 PM + 3/15/10, Jochem Maas wrote:
>>
>> Op 3/13/10 3:49 PM, Jorge Gomes schreef:
>>>
>>>  First of all, i recommend the use of normal php tags ()
>>> because
>>>  the short tags are atm marked as* **DEPRECATED*.
>>
>> that's a documentation error.
>>
>>>
>>>  You should also echo your values to the page, instead using the shortcut
>>> >>  (stop being a lazy ass! :P):
>>
>> it's not lazy, it's succinct and much easier to read (once you know what
>> it means),
>
> Yes, but like all web languages, they don't live in a vacuum -- they must
> play well with others to survive. Programming is dynamic not static.
>
> While using " and therein lies the problem. If XML (and possibility others) don't accept
> the short term tag, then why use it?
>
> Using "Standards" like this help promote better communication between all
> languages -- what's wrong with that? Simply put, either communicate better
> or don't -- that's your choice -- but your decision is also a demonstration
> to your client/employer/peers as to your desire to produce the "best"
> possible code.
>
> I look at code containing " and embedded styling for presentation -- "This must be old code OR the
> programmer still doesn't get it".
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-16 Thread tedd

At 5:54 PM + 3/15/10, Jochem Maas wrote:

Op 3/13/10 3:49 PM, Jorge Gomes schreef:

 First of all, i recommend the use of normal php tags () because
 the short tags are atm marked as* **DEPRECATED*.


that's a documentation error.



 You should also echo your values to the page, instead using the shortcut 

it's not lazy, it's succinct and much easier to read (once you know 
what it means),


Yes, but like all web languages, they don't live in a vacuum -- they 
must play well with others to survive. Programming is dynamic not 
static.


While using "others" and therein lies the problem. If XML (and possibility others) 
don't accept the short term tag, then why use it?


Using "Standards" like this help promote better communication between 
all languages -- what's wrong with that? Simply put, either 
communicate better or don't -- that's your choice -- but your 
decision is also a demonstration to your client/employer/peers as to 
your desire to produce the "best" possible code.


I look at code containing "tables and embedded styling for presentation -- "This must be old 
code OR the programmer still doesn't get it".


Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: PHP in HTML code

2010-03-16 Thread Bob McConnell
From: Ford, Mike
> From: Ashley Sheridan
>> On Tue, 2010-03-16 at 11:16 +, Ford, Mike wrote:
>> 
> >> 
> >> Proof: http://marc.info/?l=php-internals&m=126832992915664&w=2
> >> 
>> 
>> That's not really proof of anything, it's just an archived email
>> from this list...
> 
> Well, firstly it's an archived email from the *internals* (i.e.
> PHP developers) list, not this one. And secondly it's from
> someone whom I trust to know what he's talking about. If I
> looked, I'm sure I could dig up several similarly definitive
> (but less recent) pronouncements from PHP "names", including
> Rasmus himself.
> 
> In fact: http://marc.info/?l=php-internals&m=123969574312781&w=2 

Well, that's their prerogative, but I believe they are wrong. Short tags
cause more problems than they will ever solve, and should be removed
from the language ASAP. I would classify that as a design flaw.

In the meantime, since we are upgrading our pages to XHTML, we are
replacing the short tags wherever they occur.

Bob McConnell

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: PHP in HTML code

2010-03-16 Thread Ford, Mike
> -Original Message-
> From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
> Sent: 16 March 2010 11:16
> 
> On Tue, 2010-03-16 at 11:16 +, Ford, Mike wrote:
> 
> > 
> > Proof: http://marc.info/?l=php-internals&m=126832992915664&w=2
> > 
> 
> That's not really proof of anything, it's just an archived email
> from this list...

Well, firstly it's an archived email from the *internals* (i.e. PHP developers) 
list, not this one. And secondly it's from someone whom I trust to know what 
he's talking about. If I looked, I'm sure I could dig up several similarly 
definitive (but less recent) pronouncements from PHP "names", including Rasmus 
himself.

In fact: http://marc.info/?l=php-internals&m=123969574312781&w=2 

Cheers!

Mike

 -- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Leeds Metropolitan University, C507, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom 
Email: m.f...@leedsmet.ac.uk 
Tel: +44 113 812 4730





To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm


RE: [PHP] Re: PHP in HTML code

2010-03-16 Thread Ashley Sheridan
On Tue, 2010-03-16 at 11:16 +, Ford, Mike wrote:

> > -Original Message-
> > From: Bob McConnell [mailto:r...@cbord.com]
> > Sent: 15 March 2010 18:13
> > 
> > From: Jochem Maas
> > 
> > > Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> > >> First of all, i recommend the use of normal php tags ( > ?>)
> > because
> > >> the short tags are atm marked as* **DEPRECATED*.
> > >
> > > that's a documentation error.
> > 
> > No it's not. The short tags conflict with both XML and XHTML and
> > therefore are being phased out.
> 
> Jochem is right, Bob and Jorge are wrong.
> 
> Proof: http://marc.info/?l=php-internals&m=126832992915664&w=2 
> 
> Cheers!
> 
> Mike
>  -- 
> Mike Ford,
> Electronic Information Developer, Libraries and Learning Innovation,  
> Leeds Metropolitan University, C507, Civic Quarter Campus, 
> Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom 
> Email: m.f...@leedsmet.ac.uk 
> Tel: +44 113 812 4730
> 
> 
> 
> 
> 
> To view the terms under which this email is distributed, please go to 
> http://disclaimer.leedsmet.ac.uk/email.htm
> 


That's not really proof of anything, it's just an archived email from
this list...

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] Re: PHP in HTML code

2010-03-16 Thread Ford, Mike
> -Original Message-
> From: Bob McConnell [mailto:r...@cbord.com]
> Sent: 15 March 2010 18:13
> 
> From: Jochem Maas
> 
> > Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> >> First of all, i recommend the use of normal php tags ( ?>)
> because
> >> the short tags are atm marked as* **DEPRECATED*.
> >
> > that's a documentation error.
> 
> No it's not. The short tags conflict with both XML and XHTML and
> therefore are being phased out.

Jochem is right, Bob and Jorge are wrong.

Proof: http://marc.info/?l=php-internals&m=126832992915664&w=2 

Cheers!

Mike
 -- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Leeds Metropolitan University, C507, Civic Quarter Campus, 
Woodhouse Lane, LEEDS,  LS1 3HE,  United Kingdom 
Email: m.f...@leedsmet.ac.uk 
Tel: +44 113 812 4730





To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: PHP in HTML code

2010-03-15 Thread Ashley Sheridan
On Mon, 2010-03-15 at 14:12 -0400, Bob McConnell wrote:

> From: Jochem Maas
> 
> > Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> >> First of all, i recommend the use of normal php tags ()
> because
> >> the short tags are atm marked as* **DEPRECATED*.
> > 
> > that's a documentation error.
> 
> No it's not. The short tags conflict with both XML and XHTML and
> therefore are being phased out. You should be replacing them as quickly
> as you can.
> 
> Bob McConnell
> 
> 


I don't see where in the documentation where it's marked as deprecated.

Thanks,
Ash
http://www.ashleysheridan.co.uk




RE: [PHP] Re: PHP in HTML code

2010-03-15 Thread Bob McConnell
From: Jochem Maas

> Op 3/13/10 3:49 PM, Jorge Gomes schreef:
>> First of all, i recommend the use of normal php tags ()
because
>> the short tags are atm marked as* **DEPRECATED*.
> 
> that's a documentation error.

No it's not. The short tags conflict with both XML and XHTML and
therefore are being phased out. You should be replacing them as quickly
as you can.

Bob McConnell


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-15 Thread Jochem Maas
Op 3/13/10 3:49 PM, Jorge Gomes schreef:
> First of all, i recommend the use of normal php tags () because
> the short tags are atm marked as* **DEPRECATED*.

that's a documentation error.

> 
> You should also echo your values to the page, instead using the shortcut  (stop being a lazy ass! :P):

it's not lazy, it's succinct and much easier to read (once you know what it 
means),
but ... if you require portable code and your liable to be running on shared
hosting where you don't control the ini settings you might consider not using 
it.

it is often feasable to turn them on explicitly in your 'init' routine so that
your template/output code can use short tags:



I can't recall that this is ever locked down on a server so that you can't
change it, although the default if quite often set to FALSE.

> 
> 
> 
> 
> 
> 
> 
> 
> remember that between tags, we have normal php code.
> 
> Rewards

how much?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP in HTML code

2010-03-13 Thread Jorge Gomes
First of all, i recommend the use of normal php tags () because
the short tags are atm marked as* **DEPRECATED*.

You should also echo your values to the page, instead using the shortcut 







remember that between tags, we have normal php code.

Rewards
___
Jorge Gomes


2010/3/13 David Robley 

> Martine Osias wrote:
>
> > An HTML/PHP code migrated to a different hosting platform seems to behave
> > differently. The PHP statements within HTML fields or within tables  does
> > not execute
> >
> > PHP within table:
> >
> > 
> >   >  align="left">
> >  
> >
> > This PHP code doesn't print in the HTML page.
> >
> > PHP within form field:
> >
> >  > readonly="">
> >
> > This PHP code shows on the page when it shouldn't. The same variable is
> an
> > input and an output in this form:
> >
> > 
> 
> >
> > Are there times when the 
> Yes - when short_open_tag is disabled in the config. See
> http://www.php.net/manual/en/ini.core.php#ini.short-open-tag for more
> info.
>
> I'd suggest you move away from using short tags, if for no other reason
> than
> portability.
>
>
> Cheers
> --
> David Robley
>
> A conclusion is simply the place where you got tired of thinking.
> Today is Boomtime, the 72nd day of Chaos in the YOLD 3176.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP] Re: PHP in HTML code

2010-03-12 Thread David Robley
Martine Osias wrote:

> An HTML/PHP code migrated to a different hosting platform seems to behave
> differently. The PHP statements within HTML fields or within tables  does
> not execute
> 
> PHP within table:
> 
> 
>align="left">
>  
> 
> This PHP code doesn't print in the HTML page.
> 
> PHP within form field:
> 
>  readonly="">
> 
> This PHP code shows on the page when it shouldn't. The same variable is an
> input and an output in this form:
> 
> 

> 
> Are there times when the http://www.php.net/manual/en/ini.core.php#ini.short-open-tag for more info.

I'd suggest you move away from using short tags, if for no other reason than
portability.


Cheers
-- 
David Robley

A conclusion is simply the place where you got tired of thinking.
Today is Boomtime, the 72nd day of Chaos in the YOLD 3176. 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php