Always close <p>, but never close <li> :) On Jul 19, 2012 4:44 PM, "Larry Garfield" <la...@garfieldtech.com> wrote:
> On 7/19/12 5:11 AM, Peter Beverloo wrote: > > I have seen this problem happen, people losing time trying to figure out >>> what is wrong only to find >>> its a missing bracket. >>> As Paul said, this is bug-prone. >>> >>> >> Other bracket-less blocks allow authors to shoot themselves in the foot >> equally so, yet PHP supports these as well. The actual problem here is an >> inconsistency in the parser, which I'd consider to be a bug. >> >> Peter >> > > > PHP doesn't support optional brackets on functions, either; please no one > suggest that. > > Yes, it's inconsistent that some structures allow short-circuited > brackets. The solution isn't to let all structures have the bug-attracting > syntax. If it wouldn't break a few zillion lines of existing code I'd say > we should resolve the inconsistency by making the braces required on > if/foreach/etc. PHP only has them optional due to a C/C++ legacy, which > may have made sense when the byte size of source code actually mattered for > storage efficiency. > > Yes, I have run into bugs that were caused by people forgetting braces. > Yes, I have introduced bugs without realizing it because someone left off > a brace and I didn't notice it. Yes, I now always add braces when looking > at someone's code; I can't even read it otherwise anymore. Any respectable > coding standard requires the otherwise-optional braces. > > And yes, I always close my </p> tags as well, and so should you! :-) > > --Larry Garfield > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >