Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Matthew Carter Newsgroups: comp.lang.php Subject: Re: Check for military time Date: Thu, 29 Oct 2015 21:44:28 -0400 Organization: Ahungry (http://ahungry.com) Lines: 69 Message-ID: <87y4elb05f.fsf@ahungry.com> References: <1874827.QbCUPLQBcH@PointedEars.de> <562F77B7.1050001@arnowelzel.de> <8737wvd78w.fsf@ahungry.com> <5631e20e$0$23743$e4fe514c@news.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="7c986cd4736462de309a749b207746fe"; logging-data="6172"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JF9oSZehSx+bDl6sAe4S1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:kVPZBrBuy9esxt2ioEpbl40oAcM= sha1:PNM26HO7V7lEk8ZUHoIQe03O/H0= Xref: csiph.com comp.lang.php:15805 Erwin Moller writes: > On 10/28/2015 4:29 AM, Jerry Stuckle wrote: >> >> YOU don't see any problem. Good programmers do. >> >> Just wait until you run into a problem because of it. Your tune will >> change. And I'm not the only one who feels this way. >> > > Seconded. > Always use the closing tag. > > > If you get into trouble because you produce output after the closing > tag, get another job. > If that is over your head, you should change jobs, not the programming > language (or usage of it). > It isn't that hard. > This advice from php.net is ridiculous. > > This reminds me a lot of the curly bracket in conditional statements. > Some seem to think omitting them is alright for single statements. > It is, of course, not alright to omit them. > > > Regards, > Erwin Moller Other than a feeling of self righteousness, what is gained again? Tell me, in these two sample files, which is easier to debug if the aforementioned use cases occurred that cause an error when the file is included by another file making use of header responses: ------------------File One (no closing tag, misplaced HTML)----------- This is my great page of addition! ------------------File Two (closing tag, extra space)----------------- Assuming both were included/required in another file, which one would the majority of programmers have an easier time pinpointing the error with? (hint: the one where the PHP error reporting would tell you exactly where the faulty HTML was originating, NOT the file that was outputting some whitespace before a header call - that error would send you to the header() call line, not the bad file with trailing space). There have been 0 good reasons for including a closing tag (it's just too bad we can't actually have a '.phpdef' file type or something that simulates a 100% PHP only file, without dropping in and out of tags and just avoids the use of the nonsense entirely). -- Matthew Carter (m@ahungry.com) http://ahungry.com