-- 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?
And hell, the fact that people have that opinion stems from somewhere. And that is a fact we should all take a note of -- to build better tools. You see, PHP is nothing but a tool, and as a tool, it's not very liked one due to it's flaws. Solution? Abandon it! Build new, better tools instead of feeling threathened.
Le PHP sink and die it's well deserved death and make way for better tools, because professionals shouldn't feel attached to their tools, instead they should be critical towards them and look to find better ones.
But we need to actually move away from using bad tools (and this has happened with PERL) and start using the newer, better tools more often. Every software developer should learn some Erlang (or Elixir), some Clojure, some Go, etc.
If you don't try these tools out and kick the tires for a while, then you end up stuck in the past like all those COBOL programmers.
Clojure isn't new. Not to take a dig at Rich Hickey, but everything he is doing with immutable objects was done more than a decade ago by the likes of Henry Baker (http://home.pipeline.com/~hbaker1/home.html). Of course, everything that has ever been tried at all has been tried in some variant of Lisp/Scheme at one point in time.
Stop while you're behind. Nobody believes that Henry Baker's papers are equal to what Rich Hickey has done with immutable objects. Geez, get a grip on reality man.
But is it solving more problems than it creates?
Where will Perl 6 sit when/if it becomes something you could realistically use? Would you classify it as one of the bad tools or a newer, better one?
"it's not very liked one due to it's flaws", PHP is very well liked, just not by everyone .. which goes for most things in life.
If you really need it, here's a very good write-up which should cover that in an impressively detailed manner:
http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
He has updated the article over time which is good of him, but much of it is still subjective and from a quick glance there are points that no longer hold true.
http://forums.devshed.com/php-development-5/php-is-a-fractal...
But from a glance, it looks like the one writing the rebuttal didn't really understand the criticism, and is himself 100% captured by the exact mindset which the original article criticized PHP for having.
This guy is the one who will be standing at the door complaining that you just broke his house. He is what is wrong with PHP.
And naturally, however much sense he thinks his argument makes, it will still be wrong. It's in the very nature of this situation.
Efforts are being made to clean it up, but for a language to ever end up in a place with that sort of library functions is a pretty big red flag.
At the time it was reasonable .. but PHP evolved and learned lessons, it didn't just stop there as you seem to be saying.
Why is exposing a C library's functions and their names PHP's fault?
[1] http://dev.mysql.com/doc/refman/5.5/en/mysql-escape-string.h... [2] http://dev.mysql.com/doc/refman/5.5/en/mysql-real-escape-str...
And that's why it's impossible to build frameworkless PHP code that is elegant, something that even the designed-in-10-days javascript lets you do.
Still, i like php for its getting things done mentality. What it lacks in elegance it makes up for in productivity.
I stand by my comment. I can see why people like PHP but nobody in their right mind should deny that it is a mess and that it was constructed haphazardly.
On the other hand -- and I say this as a smoker, albeit as one who's cut back his habit to almost nothing over the last couple years -- smoking is an awful habit, which is both severely addictive and without meaningful benefit for the person with the habit or for anyone else. So I suppose I'm not all that inclined to quibble about the not-quite-perfect parallel, after all. :)
edit: you know what would be great, if you could show some common programming examples in PHP and how Go would manage the same situation.
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.
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