I do agree with a lot of what was being said. But what can you do?
It would not be easy. I lack the skills required. And those who have
the skills lack the monumental time required. But PHP could do what
Adobe did with Actionscript. But it would not be easy or painless. It
probably isn't worth it. But the tools are in place and there are RFC
ideas out there that, taken together might accomplish a fix. But to
what end?
The idea I thought of a long time ago when AS3 came out was to do much
the same with PHP. PHP 6 would ship with a legacy mode. In that mode
all the existing functions would exist on the root namespace. Turn it
off though and those functions disappear and get moved to \Legacy.
What actually remains is a remapped function library, perhaps taking
advantages of the autoboxing RFC to "fake" primitives as objects and
allow the sort of chaining we see in JavaScript. Not every possible
function would be present in this model - libraries such as mysql,
mysqli or pdo would be imported into scope.
But this wouldn't be easy, and I don't think the willpower exists to
do it. This is after all a volunteer effort, and there are some things
that are simply out of the scope of such efforts.
PHP's goal has always been KISS, but the decisions over the last few
years run contrary to that. Most onerous is, where Javascript, Java
and C have one scope resolution operator - a period - PHP has three
(->, , :: ). The only possible backwards compat fix to that is to
set up PHP 6 to not give a rat's ass about which of the three you use.
That would restore simplicity, and two of the operators would die off
(my money is on :: and \ dying) in common use. The engine
implications of that change are likely staggering. This isn't the
only structural issue that needs to be addressed either. Taken
together they are significant.
As to the original post that started this - it is what it is, a
blogger wanting attention, stating the obvious and trying to look
smart. I'm singularly unimpressed and reading the other responses I'm
not alone.
It would help to have a conversation about what we want the next major
to be like before starting any work on it. Otherwise it will just be
another evolution when what PHP really could use is a revolution the
likes of which hasn't been seen since PHP 3 came out. But that
conversation itself will take time and the scope of what must be done
must truly be daunting.
These are mostly quirks of the language. You learn to live with them.
I don't make excuses for it. It is what it is.The only thing that infuriates me is the ternary operator being left
associative. I want that fixed - screw bc on that one! I have been
programming for 10 years and that one still confuses me! Most people
just add parentheses to "fix" the problem. I wish someone would write
an RFC to change this to right associative like every other language!
hint hintLuke Scott
Hi folks,
today I read this post, I think that some points are valid, follow the link for
you guyshttp://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
Adir Kuhn
ZCE - Zend Certified Engineer **PHP 5.3 #ZEND004035
PSMI - Professional Scrum Master I
Hi!
PHP's goal has always been KISS, but the decisions over the last few
years run contrary to that. Most onerous is, where Javascript, Java
and C have one scope resolution operator - a period - PHP has three
(->, , :: ). The only possible backwards compat fix to that is to
This is not true. C++ (I assume that is what you mean by C) has -> and .
and ::. Of course, when you say "scope resolution", you mean a number of
different things. Javascript does not have namespaces at all - they use
huge objects for that instead, but Javascript is not OO so totally
different approach. Java does use . for everything, but I'm not sure
it's actually for the best.
That would restore simplicity, and two of the operators would die off
(my money is on :: and \ dying) in common use. The engine
No it would not restore simplicity. If you read the history of why
came into being (I know, nobody ever would do that, unless somebody
writes a fantasy book about it with zombies and vampires, but let's
assume for the sake of discussion) you'd see that initially we would
have used ::, but that created a number of ambiguities which people
though would be confusing.
I personally think we could have lived with it and worked around it for
the sake of better esthetics but the community decided simplicity is
more important, so it was made so.
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227
Hi, Michael
2012/4/13 Michael Morris dmgx.michael@gmail.com
It would not be easy. I lack the skills required. And those who have
the skills lack the monumental time required. But PHP could do what
Adobe did with Actionscript. But it would not be easy or painless. It
probably isn't worth it. But the tools are in place and there are RFC
ideas out there that, taken together might accomplish a fix. But to
what end?
I'm currently working on getting into the C (and C++) code for PHP,
reading the articles on ircmaxell's blog:
http://blog.ircmaxell.com/2012/03/phps-source-code-for-php-developers.html
If you want to develop and help the php-community, I think this is a
good place to start from.
The idea I thought of a long time ago when AS3 came out was to do much
the same with PHP. PHP 6 would ship with a legacy mode. In that mode
all the existing functions would exist on the root namespace. Turn it
off though and those functions disappear and get moved to \Legacy.
What actually remains is a remapped function library, perhaps taking
advantages of the autoboxing RFC to "fake" primitives as objects and
allow the sort of chaining we see in JavaScript. Not every possible
function would be present in this model - libraries such as mysql,
mysqli or pdo would be imported into scope.
On one side I'd like to have a namespaced core ... but I don't think
this would be a good idea to say that no script written for PHP5 will
work in PHP6 an vice-versa.
But this wouldn't be easy, and I don't think the willpower exists to
do it. This is after all a volunteer effort, and there are some things
that are simply out of the scope of such efforts.PHP's goal has always been KISS, but the decisions over the last few
years run contrary to that. Most onerous is, where Javascript, Java
and C have one scope resolution operator - a period - PHP has three
(->, , :: ). The only possible backwards compat fix to that is to
set up PHP 6 to not give a rat's ass about which of the three you use.
That would restore simplicity, and two of the operators would die off
(my money is on :: and \ dying) in common use. The engine
implications of that change are likely staggering. This isn't the
only structural issue that needs to be addressed either. Taken
together they are significant.As to the original post that started this - it is what it is, a
blogger wanting attention, stating the obvious and trying to look
smart. I'm singularly unimpressed and reading the other responses I'm
not alone.It would help to have a conversation about what we want the next major
to be like before starting any work on it. Otherwise it will just be
another evolution when what PHP really could use is a revolution the
likes of which hasn't been seen since PHP 3 came out. But that
conversation itself will take time and the scope of what must be done
must truly be daunting.