by xd · 12y ago · 0 comments
Getting real tired of seeing these baseless statements from so called software professionals.
Here is an off-the-top-of-my-head list of features of modern day PHP:
* yield
* event
* pthreads - yeap, real threads.
* closures (including support for $this)
* consistent hashing api
* "finally" added to try-catch
* empty() now supports expressions, rather than only variables.
* array and string literal dereferencing
* foreach support for list() - foreach($array as list($var, $var))
* array_column
* traits
* short array syntax
* namespaces
* json manipulation is second to none.
* runkit - all kinds of danger here
-- Rasmus Lerdorf
The whole point of HHVM is to migrate away from the PHP runtime (by using the PHP language on another runtime). It's a bit perverted to say that's a god thing for PHP.
If you where in the pub and someone spent some time listing the virtues of the pint they where drinking, and then someone joined in the conversation and called it disgusting with no basis .. wouldn't you find that to be odd behavior?
I totally understand the choice to work in shops that have legacy php code: they have money and often times don't want to change off php. Handily enough, most of us like working for money.
What caused me to retool away from php was the fear that not enough new systems were being built in it, leaving a diminishing pool of jobs for a constant pool of developers not wanting to retool. I figured I'd give up my space to someone else, and seek my fortunes on other stacks. I don't think there is anything wrong with deciding X language will be the one you ride into the sunset on (some COBOL programmers I know make crazy money due to the economics of the ratio of jobs/developers). I just personally considered the risk of a job shortage to outweigh the rush of a talent shortage. (And I am so practiced at retooling, I could probably be ready to interview for a PHP job in a few weeks if I had to).
I think of choice of stacks from the agile way, "make it fast to change, and you'll be ready to snatch up arbitrage opportunities when they arise." Rather than the waterfall way, "pick the right tech that will last your career at the point of maximum ignorance".
I think most people mock PHP just because it's fashionable to do so, it's the "easy joke" that vb6 used to be. I wouldn't take it personally, you should own your choices.
You're calling this guy[1] a 'so-called software professional' because he criticised PHP?
* closures (including support for $this)
I looked at this a couple days ago, because closures make a lot of problems easier. However, PHP's handling of closures is more than a bit ugly and hackish. Yes, it supports $this, but this was done after the initial release, doesn't give much confidence in how it's handled under the hood. Plus, you have some real syntactic ugliness; in order to scope variables into a closure, you have to declare them again with a now overloaded keyword -- use -- with them passed by value by default. Closures in pretty much any other language, you just put them in the scope of your function and the compiler/interpreter knows how to handle them without any hints from you.While php is less bad now, there's still quite a bit of ugliness in it due to its tendency to just spackle new parts on without any regard for what the end result looks and functions like. The php team needs to make a concerted effort to clean the language of its rough points, even if it breaks backwards compatibility, otherwise, useful ideas will continue to be hampered by an overbloated ugly core.
However the objection people, including myself, have with PHP is that the legacy stuff is inconsistent junk.
I still use it on occasion but it pains me.
Exactly like Javascript in this regard. I've been programming JS for over 15 years, and with the exception of cross browser support back in the day, there's nothing that had me startled after I learned the language -- except for a few issues related to floating point that I stumble upon now and then, but then that would be true for floating point math in any language.
The only PHP inconsistency is with the naming of the built-in functions. Functionality wise, most are solid bindings of respected C libraries. And, really, the needle/haystack thing has been blown out of all proportion. As if that's the biggest challenge one faces when programming.
As to parameter ordering .. I've been using PHP for so long now that they've been memory to committed ;)
PHP used to be by far the easiest language to get started with for web dev. This is not the case anymore.
And while you're certainly entitled to disagreement, Tim Bray is about as far from "so called" you can get for a software professional.
um - who would be the contenders? in terms of getting started, which also means deploying and see your stuff on something other than your local machine, I can't think of anything better supported than PHP. Most budget hosting you can simply upload your brand new, first-ever PHP script and have it 'just work'. No need to worry about wsgi, cgi-bin, application servers or anything.
As much as I loathe PHP because it sweeps the developer towards bad habits and unreadable, bug-ridden, slop, I love it because, rather like a bash, it's a flexible and comprehensive tool in my toolbox.
Here's a good start - and I'll bet that Heroku's free tier is a better option than most $5/month PHP webhosts:
You do have some really nice frameworks that hide the procedural stuff, like laravel, and that code looks nice, but it is really slow. And this is the inherent conflict of the php developer. If you write raw php, it is ugly but fast. If you use a framework it is pretty but slow. The techempower benchmarks [1] demonstrate this, where raw php performs at near-native speeds, but frameworks like symfony and laravel are embarassingly slow in comparison.
So, php's scorn is well deserved. It's productive, yes, but it is impossible to build a world-class top-performing app in it and still get clean and consistent code without jumping through some sizeable hoops (like facebook did by building their own php engine and php-like language called Hack, in addition to their own frameworks).
[0] https://github.com/jsebrech/php-o
[1] http://www.techempower.com/benchmarks/#section=data-r8&hw=i7...
Even if a handful of those issues have been addressed in the intervening 15 months, the depth and breadth of fundamental problems remains. /$.02
There's a lot wrong with PHP, and that'd be the case if even a quarter of the points in the article I linked to were valid.
PS Feel free to get the last word in after this, I don't plan to reply again since it's not very constructive. Have a nice day.
It's distressing to say the least to many of us people who have studied programming languages a lot, that the quality of design and coherence in your programming language has almost no effect (or even negative correlation!) to how well it succeeds.
PHP with these features has become more of a headache.