On Fri, 2010-01-08 at 21:30 +0000, Stuart Dallas wrote:

> On 8 Jan 2010, at 20:49, LinuxManMikeC wrote:
> 
> > http://framework.zend.com/manual/en/coding-standard.html#coding-standard.overview.scope
> > "This document provides guidelines for code formatting and
> > documentation to individuals and teams contributing to Zend
> > Framework."
> > 
> > So as far as anything other than code being contributed to Zend
> > Framework, its just a suggestion.  For your programming team, you're
> > the boss, you make the decision.  The only benefit I see is preventing
> > the white space mistake (as your co-worker's quote mentioned), but I
> > agree with you on that point.  "Just don't put any white space
> > there... moron..." :-)  Its an inconsequential option, pull rank, get
> > back to work.
> 
> My opinion is that it's not an inconsequential option. Putting it in can 
> cause issues, leaving it out does nothing but rub against some people's sense 
> of neatness and order. Given the choice I'll always vote for the one that 
> doesn't cause issues - I'd rather have people a tiny bit uncomfortable with 
> not having it there than finding out there's a bit of whitespace at the end 
> of a file when it could be in one of thousands. But maybe that's just me.
> 
> -Stuart
> 
> -- 
> http://stut.net/
> 
> > On Fri, Jan 8, 2010 at 1:24 PM, Daevid Vincent <dae...@daevid.com> wrote:
> >> I'm having a debate with a co-worker about adding the final ?> on a PHP
> >> page...
> >> 
> >> To be honest, I am the lead, and I could pull rank and be done with the
> >> discussion, however I don't like to be that way. I would rather do the
> >> right thing. If my way of thinking is old-school (I've been coding since
> >> PHP/FI), and what he says is the newfangled proper PHP/Zend way, then I'd
> >> rather adopt that, despite how icky it makes me feel to leave an unclosed
> >> <?php just dangling and alone, all sad-like. In my mind, "nobody gets left
> >> behind"! :)
> >> 
> >> Is there ANY side-effects to leaving the end ?> off? Is it any more work
> >> for the compiler? And yes I know computers are hella-fast and all that, but
> >> I come from the gaming industry where squeeking out an extra FPS matters,
> >> and shaving off 0.01s per row of data in a table matters if you have more
> >> than 100 rows. A 1 second wait IS noticeable and a 10 second is even moreso
> >> -- just try to talk for 10 seconds straight without a pause. Or sit there
> >> and stare at a screen for 10 seconds!
> >> 
> >> If the main argument is that it's to prevent white-space after the code,
> >> then most modern editors that I'm aware of will automatically trim
> >> white-space (or have a setting to do so). Plus this is ONLY a factor when
> >> you're trying to output a header and things like that. In 90% of your code,
> >> you don't deal with that. It's also obvious enough when you have an extra
> >> character/space because PHP pukes on the screen and TELLS you something
> >> about "blah blah sent before header output" or something to that effect.
> >> 
> >> What do you guys all do?
> >> 
> >> I also created a poll here http://www.rapidpoll.net/arc1opy
> >> 
> >> -----Original Message-----
> >> From: Co-worker
> >> To: Daevid Vincent
> >> 
> >> Actually, Zend states that you should omit the final ?> on include pages.
> >> There is no harm in the action, and it prevents you from accidentally
> >> adding white space after the tag which will break the code.
> >> 
> >> http://framework.zend.com/manual/en/coding-standard.php-file-formatting.htm
> >> l
> >> 
> >> 
> >> -----Original Message-----
> >> From: Daevid Vincent
> >> To: Co-worker
> >> 
> >> Please DO include the final ?> I noticed on several of your files that you
> >> have purposely omitted it. Yes, I know the files work without them, but it
> >> makes things easier to see the pairings for matching <?php . Plus it keeps
> >> things consistent and I'm not a big fan of "special cases" as this is,
> >> especially if it's a bad habit to get into since in all other cases it's
> >> required except this one "lazy" one. If you are concerned about white space
> >> sending in a header or something, well then just make sure there isn't any.
> >> I've had no problems and it makes you a more careful coder.
> >> 
> >> Thanks,
> >> 
> >> Daevid.
> >> 
> >> 
> >> --
> >> 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
> > 
> 
> 


If someone is leaving whitespace all over the place that's causing those
sorts of problems, then their use of ?> is the least of your problems,
as I suspect their code layout is probably atrocious!

Getting code laid out correctly is far more important an issue than a
closing ?>, and when it's done correctly, you avoid a lot of problems,
more than a closing ?> can cause.

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


Reply via email to