I just discovered that PHP 6 is officially deprecating short tags. I'm sorry, but short tags are incredibly useful. They should be turned on for every server. They simplify coding dynamic actions within HTML. Plus, you get the added bonus of using:
Which is short for:
<?php echo $x; ?>
Compare: 7 characters vs. 17 characters. The latter is over twice the length, quite unreadable, and, from personal experience with large code bases, unmaintainable! Typing 'php echo' in every time I want to execute/display data that is hosted within the PHP engine is ridiculous. This is a step backwards going in the wrong direction.
The lame excuse for removing short tags is XML. PHP is for HTML, not XML.
I write PHP code quite regularly. Prior to PHP 5, PHP stunk. PHP 5 really changed my view of scripting languages. PHP 6 is going to ruin that view as we will return, once again, to the dark ages of software development. What really gets me is that someone made a decent recommendation and the PHP development team scoffed at the idea and one person even had the gall to suggest that syntax highlighting is all that is needed - let me point out that blind PHP programmers probably don't want to hear JAWS attempting to speak '<?php echo' over and over again and syntax highlighting is a useless recommendation to a blind programmer. I can imagine a small army of blind PHP programmers beating up the PHP developers (especially the one developer who made the recommendation to use syntax highlighting) while blaring an audio recording of JAWS speaking '<?php echo' over and over.
XML seems to be the pervasive reason. I personally dislike XML and wish it would go away (I also wish Ruby, Perl, and Python would go away too - all three are equally terrible languages - and, yes, I've used them all). I've used XML enough to know that it is a terrible storage mechanism for any data. JSON is better but still not perfect. The PHP serialize() function gets even closer but is a language-specific solution. XML is hereby a lame excuse for not coming up with an alternate short tag strategy.
If XML is sooo important, then simply recognize the sequence of characters '<?xml ' and ignore it. It is already invalid PHP code, so fix the problem transparently. Oh the horror! Three lines of code at most is all that is needed. This whole issue is over a data storage format that isn't commonly output by PHP, is a terrible storage format to begin with, and is over the two starting characters at the very beginning of the storage format. Most people DO NOT EVEN USE XML in the first place! Requiring '<?php echo ' every time output is needed from within the PHP engine in HTML is a surefire way to tick people off. Especially when they learn that the reasoning is the two measly characters at the start of a XML document.
Good grief. I can't believe I'm having to tell the PHP developers how to write software. I'm now going to start tagging posts with "maximum failure" for areas where programmers have failed spectacularly to see the simple solution to a problem. End-users (PHP programmers) want short tags in PHP, the PHP developers see a singlular issue with XML and proceed to blow the whole thing out of proportion, and there is an easy fix (see previous paragraph) that allows both camps to be happy - it is as simple as that.
I'm hoping that as soon as PHP 6 comes out of its internal development cycle and becomes the official release, there will be a significant (read: massive) backlash in the short tag department. In other words, I'm hoping the PHP developers will be forced to add short tags back in and undeprecate them. The only reason there hasn't been a huge backlash already is because: No one knows they are already deprecated, deprecated functionality is rarely enforced, and people are too lazy to rewrite code that works just fine. So, I have one question:
Can the PHP internal developers mailing list handle a million programmers dropping by and asking the same question over and over and over and over and over and over again?
Edit: To date I've rejected all comments to this post. People are attacking me personally and completely ignoring both the purpose of this post and this blog as a whole. This is my rant blog - a place to let off steam - if you don't like it, then don't comment and simply leave. Sheesh.