Skip to content

re: PHP needs its own ES6 VIEW POST


The comparison is not fair.
You are comparing PHP, where a few functions are not consistent, versus JavaScript (or ECMAScript), where the whole language is a clusterfuck.

ps: Even his community is a mess. NPM... ha.


If you read it again, you'll discover it's not a comparison.


But you are saying that "es6" is the way to follow. Why?. Was the migration es6 painless?. of course not, it is painful and most developers aren't even using it (4 years and counting), they are using CoffeeScript, Babel or ActionScript, so es6 is a promise, not a reality.

So, do you think PHP need to start from zero or redone some stuff like the guys of JavaScript are doing?. Why?.

Javascript wasn't "redone from the ground up". They simply added a bunch of new/nice features. I would also have to completely disagree with "most developers aren't even using it". That is a completely untrue statement. You claim people are using CoffeeScript. Well, I'm sorry, but if you look at statistics CoffeeScript has had a sharp decline for a while now. ES6 is in fact the current standard of the the javascript language and it is in use. A LOT...

Your statements basically come off as an offense that somebody would say javascript is better than php. (Which the author didn't do, nor did he compare them.) The author is saying that the upgrade of the ecmascript standards was very good for the language. Then he said that an upgrade to the features of php would be good for the language.

I agree with Chad here.

I think PHP would benefit from a start from zero but that's never gonna happen. Too much will break if they do. So I started to think about alternatives.

I think it's great that in Javascript, not everyone has to use ES6. I see it as an enhancement rather than requirement and I think the "ES6-for-PHP" idea could follow that. A layer on top that people can use if they want but the code that gets actually run is still plain old PHP.

And I'm not saying that we have to take a Javascript route in PHP world. ES6 just happened to be a nice model that people who've done Javascript understand as a notion. It's not removing anything from Javascript, it's not forcing anyone to upgrade, but if you want to use it, it makes writing Javascript so much nicer.

And to reply your original question Jorge:

So, do you think PHP need to start from zero or redone some stuff like the guys of JavaScript are doing?. Why?

Yes. Not necessary "like the guys of Javascript are doing" but in some way. Do you not agree on the problems I've laid out in the blog post? With the wildly inconsistent naming and function parameters, wonky array functions and functionality and other problems?


I disagree on both notions:

  1. I wouldn't say that in PHP it's only "a few functions not consistent". PHP has quite a lot of issues that stem from it not being built for this kind of use case originally but then being evolved on top of a wild wild west of weird standard library.

Like I mentioned in the beginning, it was a valid choice at the time for Rasmus to name the functions as he did.

  1. I personally think that there's a lot of similarities - not necessarily in the languages themselves but how they have evolved - in PHP and Javascript. Sure, 10 years ago Javascript was also a mess. These days, it's a joy to write with all the new stuff.

I've seen some recent JS tutorials where JS programmers make a pages/ directory and put about.js, contact.js in there and then do things like require '../utilities.js' for a dozen helper files - it makes me nostalgic for PHP circa-2005 ;-)

code of conduct - report abuse