While it's certainly true that PHP is better than it was 7 years ago, that is primarily in the ecosystem and not the language. The language remains as bad as it was 7 years ago, and they seem to be woefully unwilling to actually fix it.
A fixed php would be a different language. The differences between Python 2.x and 3.0 would be minor compared to what would need to be fixed in php... and look how well that migration has worked out for python.
In many ways PHP is just now starting to come into its own
111–120 of 133 posts
Re: In many ways PHP is just now starting to come into its own
#112Re: In many ways PHP is just now starting to come into its own
#113Earlier quoted context omitted.
Well that's why I said "even" Javascript. Brendan Eich actually pulled off a small miracle by embedding incredibly powerful functional and prototypal paradigms in JS. It's not perfect, and there are plenty of warts, but JS came out of the gate with a powerful core that PHP took decades to add in a Frankenstein manner.
Enough with the "JavaScript is a functional language" myth, please. Merely having first-class functions does not make a language a functional programming language. JavaScript does not promote the use of pure functions, referential transparency, and the minimization of state. JavaScript does not encourage the use of recursion. JavaScript has an atrociously broken type system, rather than a robust and theoretically sou…
It's certainly not accurate to categorize JS as a functional language, but it is flexible enough that one can program in a more or less functional style; and unlike PHP, it always has been.
Also, I've read several of your anti-JS diatribes, and I feel compelled to ask this: What drives you to denigrate JavaScript, and programmers who willingly choose to use it, wherever you can? Do you feel the need to show your superiority by bashing the languages that many programmers use to produce useful applications despite their lack of expertise? Can we not accept that all mainstream languages have warts, and that in many cases, practicality may dictate that we use a language that doesn't please us aesthetically but is nevertheless useful?
Re: In many ways PHP is just now starting to come into its own
#114PHP is like that old phillips screwdriver you have in your toolbox. You know, the one with a crack going down the side of the handle. Wrapped in masking tape to keep the thing together. You bought it when you moved into your first house and you need to screw a lighting fixture that was about to fall off the wall. It's been with you for years, always there in case something needed a little tightening. Sure you have be…
"I can’t even say what’s wrong with PHP, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.
You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.
You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.
You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.
And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.
Now imagine you meet millions of carpenters using this toolbox who tell you “well hey what’s the problem with these tools? They’re all I’ve ever used and they work fine!” And the carpenters show you the houses they’ve built, where every room is a pentagon and the roof is upside-down. And you knock on the front door and it just collapses inwards and they all yell at you for breaking their door.
That’s what’s wrong with PHP."
Re: In many ways PHP is just now starting to come into its own
#115Earlier quoted context omitted.
Not so fast. PHP evolved a lot as a language, maybe it will never be enough to fix its ancestry, but namespaces, closures, generators, ~~typed~~ expressions (you can finally slice a function call returning an array without unnecessary variables) and some literals. It's still not 1958-worthy to me, but they do evolve.
It is evolved indeed, but is there any language designer / guru who ever come close to exploring its good parts (like Douglas Crockford did with Javascript)? I don't think so...
Re: In many ways PHP is just now starting to come into its own
#116Re: In many ways PHP is just now starting to come into its own
#117"Jeff Atwood has stated publicly that one of his ulterior motives with the Discourse project is get people to stop using PHP and start using Ruby." This just won't ever happen. The people that wanted to drop PHP for something else (Ruby, etc) largely did so years ago. The hosting/running situation for PHP is just too basic and easy for people to get in to vs having to 'run a server' (Rails, etc). PHP is still the onl…
But you're right, PHP assuming HTML output by default is a huge boon. With node you have to set up your own server and routes, and more... That's a lot more work than installing WAMP, running it, and putting your php files in the right folder.
Re: In many ways PHP is just now starting to come into its own
#118Can anyone recommend a good PHP framework? I've used Zend and Yii - they are okay, but I'd like to try something new. So, other than these two, which ones are good?
Slim Framework http://slimframework.com as a microframework.
Re: In many ways PHP is just now starting to come into its own
#119The thing that irritates me the most with Php, is not being able to quickly jump around the code from class to class without some hack. While magic autoloaders are great my IDE/text editor isn't smart enough to know how to do this. You could probably write some code to help in this respect for your editor or use some other tools. It ultimately ends up that I want to hold too much of the project in my head, which is a…
Re: In many ways PHP is just now starting to come into its own
#120The thing that irritates me the most with Php, is not being able to quickly jump around the code from class to class without some hack. While magic autoloaders are great my IDE/text editor isn't smart enough to know how to do this. You could probably write some code to help in this respect for your editor or use some other tools. It ultimately ends up that I want to hold too much of the project in my head, which is a…
I would suggest that this in particular is a problem with your workflow and IDE/editor and not PHP. I've usually just kept everything open as a project in Sublime Text, works just fine. As far as the code itself goes, using PSR-0 and/or Composer makes most of the headaches with class loading just go away.