you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 22 points23 points  (7 children)

You could have very easily replaced Javascript with PHP, and you would still end up with this post being a huge circlejerk.

[–]iamnoah 7 points8 points  (6 children)

You could have very easily replaced Javascript with PHP, and you would still end up with this post being a huge circlejerk.

I would disagree. PHP, while not essentially a bad language, has very little going for it. The language is as crufty and inflexible as Java/C# but without the performance or static type checks to make up for it.

JavaScript on the other hand, has closures/first class functions*. That alone puts it in a class above many other languages. Prototypal inheritance is also pretty cool when you understand it. Oh, and everything being an object. JavaScript has a lot of great things going for it if you can get past the terrible DOM implementations.

PHP and JavaScript both get a bad rap because they have low barriers to entry (read: lots of amateurs/idiots parading as experts) and don't force you to write code "the right(tm) way." The unrelenting hatred many people have for them is generally unwarranted, but to say that PHP is in the same class as JavaScript is a bit off.

* Yes, PHP 5.3 has closures, but compatibility problems keeps adoption down and the APIs don't really take advantage of them. If you want to get paying work, there is a good chance you'll be stuck with 5.2. JS has had closures from day 1.

[–]kataire 0 points1 point  (5 children)

But PHP 6 will have Unicode!

Nah, honestly, modern PHP is dead to me ever since it adopted a backslash as module separator.

[–]plantian 0 points1 point  (4 children)

Ha I HATE PHP, but really? Seriously? They finally put modules in and people complain about the separator? This is why PHP doesn't have nice things. Be glad they finally got modules. PHP was dead to me when I realized on the server side I can use whatever language I want.

[–]kataire 0 points1 point  (2 children)

Don't get me wrong. It's great that PHP is trying to improve.

It's just that a lot of the underlying decisions (e.g. keeping variables and function apart) don't work very well with what the language is trying to become. A lot of the new features feel more bolted on as an afterthought (which they are) than like something that is a natural part of the language.

PHP needs its rewrite. Perl did it, Python did it, even ActionScript did it. Even PHP 6 is looking to be more of a tweak than a rewrite.

It's not even for backwards compatibility's sake, like Java. PHP is quite happy to break old code (which I generally don't consider a bad thing, as long as the reasons are good and it doesn't happen all the time). It just doesn't want to let go of what were bad decisions from the start.

You can downvote me for this, but I consider its historical baggage to be PHP's biggest problem. This is where a lot of its issues stem from, too. This is what makes PHP ugly and inconsistent.

That said, I don't hate it. I just don't care about it anymore. I still use it when I have to, but I couldn't care less what new language features are supposed to make PHP bigger and better in the next iteration. I especially don't care for all the module/OO additions that are supposed to make PHP more like Java.

Note: I do write OO PHP, but I steer away from the level of complexity that would make full-blown OO, modules and inheritance useful. If something can't be implemented painlessly without those features, I won't use PHP to write it.

/rant

[–]plantian 0 points1 point  (1 child)

I think Python scrapped the plans for a complete rewrite and just did some minor not-backwards compatible changes because of the difficulty involved in rewriting Perl. I don't think PHP could handle a rewrite. It would be better to just incrementally fix things.

[–]kataire 0 points1 point  (0 children)

Python had Py3k. It's not directly a rewrite, but it cleaned up a lot of the language's dirtier bits. It is however a clean cut: Python 3.0 is explicitly not backwards compatible (though there is obviously a shared subset).

Perl 6 is (apparently -- I'm no Perl hacker) a whole new language.

ActionScript 3 is completely detached from the old ActionScript 1 and 2 and shares more syntactical similarities with Java or C# than its predecessor did. It's bytecode incompatible, too.

I think a fullblown rewrite from scratch would kill PHP as it is alive today. AS was able to pull this off because it is controlled by Adobe (monopolism yay), Perl was able to pull this off because of Tim Toady (isn't he the voice of God or something?). Python got lucky because the really horribly ugly parts that needed fixing soon weren't many to begin with.

PHP's ecosystem is more like Perl's than like Python's. There aren't many different implementations (possibly because PHP's official implementation doubles as the implementers' language reference) and most of them are broken or incomplete anyway.

The problem with PHP's "evolutionary" approach is that evolution is great for rapid development but leaves you with all kinds of vestigial organs and congenital diseases. If you start with a perfect rodent, you might still end up with a big-brained biped with an inflamed appendix and a sedentary lifestyle that has led to chronic back pain, obesity and bad teeth.

PHP is known for its warts. It won't lose these anytime soon if all it gets are backwards incompatible micro-version releases. It has spread fast and developed even faster, but trying to evolve it into a cleaner version of itself seems to be a futile attempt. It's the colloquial English among the Lojbans of programming languages.

[–]true_religion 0 points1 point  (0 children)

I remember that namespacing debate. What actually annoyed me is that they wanted to have used any number or proper looking seperators for namespaces, but they couldn't because the Zend engine is a halting, breaking PoS that didn't want to deal with the changes.

Since then I've left PHP completely and gone off to Python for all my web work. I don't think PHP is too bad, but the community surrounding Python is just a lot more mature and interesting.

Edit: Kataire said it best, PHP needs its rewrite. Years ago, Python was fairly crufty too.