News for hackers. Stuff that matters.
Re:PHP is much better than what you think by drivebyacct2 on Wednesday July 04, 2012 @04:25AM (#4198333)
"PHP is the best web platform ever", because it (finally) has a decent package manager. And don't mind that far fetched statement, the author will surely delete any rude comments.

Congrats, PHP has a package manager. This does nothing to shake my feeling that PHP's most ardent advocates have little hands-on experience with the more full-featured alternatives. You know, like the ones that also have decent package management without PHP's baggage and limitations.

edit: hell, calling PHP a "web platform" at all is insulting. Maybe if "web platform" is constrained to JSP/PHP/ASP style pages with no more complexity. Don't mind anything that requires websockets or anything other than... PHP style page rendering.

Can we stop with the "PHP is everywhere so it must be good meme"? PHP's availability makes it convenient; it doesn't make it good. I said it before and I'll say it again despite its painful obviousness. If you want to write a random script and upload it to some $2/month hosting, PHP is great. If you're going to build a real webapp that is going to have developers working on it and real users hitting it, you're going to be on a VPS or colo or on your own metal and have all sorts of choices that... have package management and aren't PHP. And if we're talking about throwaway quickie scripts, who really cares anyway?

Re:PHP is much better than what you think by Kudos on Wednesday July 04, 2012 @05:07AM (#4198484)
When I first started looking for work here in Dublin, Ireland a few years ago, I saw tens of PHP web stack jobs, 1 RoR job and no Python jobs. While the tides have turned slightly, PHP web stack jobs here still far outnumber Ruby and Python equivalents, especially at the entry level.

Some developers like PHP because they can get easily work doing it. Businesses likes PHP because they can more easily hire people.

Arguments about PHP's ugly and stupid syntax are moot, it has been enabling companies to get shit done with developers at different skill levels for years.

Re:PHP is much better than what you think by anthonyb on Wednesday July 04, 2012 @05:46AM (#4198651)
Yeah - "shit" being the operative word there. The problem I've found is that there's a kind of anti Python paradox at work with PHP:

Better than 95% of the PHP jobs out there are horrible scut work for companies that don't give a shit about quality or decent development, even though it costs them an arm and a leg maintaining their steaming legacy codebase.

The 5% that you'd actually want to work for need to have a series of huge hurdles to keep out the 95% of PHP mouth breathers^W^Wdevelopers who can't really code.

Re:PHP is much better than what you think by EvilTerran on Wednesday July 04, 2012 @07:17AM (#4198877)
horrible scut work for companies that don't give a shit about quality or decent development, even though it costs them an arm and a leg maintaining their steaming legacy codebase

Damn, you just described my job perfectly.

"Test framework? What's that? Sounds like it'd take up too much valuable programmer time. PS enjoy walking on eggshells whenever you try to change something because there's no regressions."

(╯°□°)╯┻━┻

Re:PHP is much better than what you think by anthonyb on Wednesday July 04, 2012 @07:47AM (#4198965)
The best bit about those environments is that the devs who crank out the most code (ie. LOC-wise) are feted, but they're basically just standing in the bottom of a hole, digging.
Re:PHP is much better than what you think by EvilTerran on Wednesday July 04, 2012 @11:24AM (#4199724)
Ah, fortunately, we aren't measured by LoCs. Instead, we're measured by the number of items we manage to knock off our in-house half-arsed basecamp reimplementation. Not quite as bad, I guess.
Re:PHP is much better than what you think by ericingram on Wednesday July 04, 2012 @10:49AM (#4199599)
> "Better than 95% of the PHP jobs out there are horrible scut work for companies that don't give a shit about quality or decent development"

Show me your data? You couldn't be more wrong about the companies using PHP. The last startup I worked at in San Francisco, well funded and very successful, used PHP. I was approached by many well known names all using PHP, most of them exciting new companies working with edge technologies for practicality, which is a trait that goes great with PHP).

Re:PHP is much better than what you think by anthonyb on Thursday July 05, 2012 @02:24AM (#4201967)
> Show me your data?

Bitter personal experience? I'm a Python dev, but figured PHP and Python would be good to add to my resume. I picked them up pretty quickly, but after working for a couple of PHP places and interviewing at many others, I swore off them and went back to Python.

Also, sounds like your startup was one of the 5%, rather than the 95%.

Re:PHP is much better than what you think by TylerE on Wednesday July 04, 2012 @11:54AM (#4199825)
and for every startup company using php, there are 100 shitty local ad agencies knocking out brochure-ware wordpress sites.
Re:PHP is much better than what you think by ericingram on Wednesday July 04, 2012 @12:09PM (#4199883)
Sounds like a big success for Wordpress and PHP to me
Re:PHP is much better than what you think by wpietri on Wednesday July 04, 2012 @06:42PM (#4201038)
In the sense that McDonald's is a big success for American cuisine, sure.
Re:PHP is much better than what you think by ericingram on Friday July 06, 2012 @09:36AM (#4207613)
That's a decent analogy, since McDonald's is a huge success and a model of efficiency in business.
Re:PHP is much better than what you think by wilmoore on Friday July 06, 2012 @12:59PM (#4208563)
If more fat americans is a success, I guess that makes sense.
Re:PHP is much better than what you think by jonwinstanley on Wednesday July 04, 2012 @06:04AM (#4198704)
I have not found this to be the case. There are a lot of small/medium sized companies that probably started out with a custom Drupal/Wordpress site and have now out-grown it, but don't want to re-write the whole system just so that they can use Python/Ruby.

Using PHP is then a no-brainer and so moving the codebase to Symfony2 is a great option for them. While Wordpress and Drupal command such a large share of the website market, there will always be decent young companies emerging who are also tied-in to the PHP community.

Re:PHP is much better than what you think by pestaa on Wednesday July 04, 2012 @06:54AM (#4198807)
How is moving to Ruby/Python needs a rewrite, but moving to Symfony2 does not?
Re:PHP is much better than what you think by anthonyb on Wednesday July 04, 2012 @07:44AM (#4198958)
That's what I was wondering.

I also had a look through the Symfony2 docs. Perhaps it's just me being a Python bigot, but the code there doesn't look any better than the raw PHP: http://symfony.com/doc/current/book/from_flat_php_to_symfony... And the "helper function to render templates" in the section above it also looks fairly deranged. Isn't that included in the framework somewhere?

The bits that do look ok seem to be because they're copying Django/Jinja2 templating.

Re:PHP is much better than what you think by mechanical_fish on Wednesday July 04, 2012 @09:20AM (#4199293)
If you stay on the same web stack you might be able to migrate one piece at a time.

You also have the option of refactoring the most important or troublesome bits of your app to use Symfony2 while leaving the rest alone.

It's pretty challenging to take one piece of your big web application and migrate that to Python while leaving the rest in PHP. So you'll tend to do it all at once. That's very expensive, and very risky, even if your original ugly PHP site had an extensive test suite, which it will not.

Re:PHP is much better than what you think by jasonlotito on Wednesday July 04, 2012 @09:16AM (#4199281)
A framework shouldn't (and most all the popular PHP frameworks out there, including Symonfy adhere to this) matter when your business logic is decoupled from from your framework. Yes, you might have to rewrite some constructors. And some frameworks have different features, but can still be carried over if you need it. You aren't beholden to a single code base.

For example, I can easily move my models from Zend to Symfony without rewriting a thing. Decoupling is a wonderful thing.

So, you have this code base you are using, these libraries that are already written, and tested, and working. Moving to Ruby/Python would require that they all be rewritten, and appropriate libraries be replaces.

Moving to another language isn't a weekend endeavor when you have a workflow and toolset built up over a 10+ years of development in another language that, in that domain, accomplishes the same thing.

Re:PHP is much better than what you think by Kudos on Wednesday July 04, 2012 @11:25AM (#4199730)
So don't work for those companies?

I think you'll find a similar situation with companies using enterprise languages like .Net or Java, certainly here in Ireland where our universities heavily teach using those technologies.

Shitty graduates with no real interest in programming still end up in programming jobs. The shitty PHP developers I meet are invariably actually designers winging it as programmers.

Re:PHP is much better than what you think by aidos on Wednesday July 04, 2012 @05:17AM (#4198527)
It's a bit of a Catch22 as well. We switched to using PHP for our agency client work because it was easier to hire developers. Not only that, but clients actually ask for it by name (and we lost a number of jobs because we didn't want to use PHP). The cycle continues.
Re:PHP is much better than what you think by InclinedPlane on Wednesday July 04, 2012 @05:43AM (#4198630)
There's a good reason for that though.

If you create an app for someone in rails or django or luanode or some such then they are on the hook for maintaining it if you go away or find other work or just don't want to support it. And it's much harder to find devs for those stacks than it is to find PHP devs.

Re:PHP is much better than what you think by davidw on Wednesday July 04, 2012 @05:23AM (#4198557)
The technical term for that is "network effect".

http://www.welton.it/articles/programming_language_economics (sorry to those who have read it, but it bears repeating)

Re:PHP is much better than what you think by scott_w on Wednesday July 04, 2012 @06:36AM (#4198775)
I have to admit that I've turned down potential freelance stuff when the customer requests PHP (or has signed up for a service that only allows PHP).

Of course, I have a full-time job, and the freelancing is usually to pay for a new guitar or something. Your situation is probably different from mine, and needs must.

Re:PHP is much better than what you think by clown on Wednesday July 04, 2012 @05:21AM (#4198542)
I don't mean to belittle you or anything like that, but isn't it your job to consult the client on the best tool for the project? If they are adamant on using PHP, when it's clear PHP isn't suited, perhaps that implied an awkward client.
Re:PHP is much better than what you think by aidos on Wednesday July 04, 2012 @05:48AM (#4198654)
Not really, they look at it the same way - we're building something for them they need to support long(er) term. It's a pretty simple business decision really. A number of clients have been burnt in the past by having to support something a bit esoteric. Often clients actually ask for Drupal (which we downright refuse to do) for that very reason. They want something that's they'll be able to find developers for.
Re:PHP is much better than what you think by jakejake on Wednesday July 04, 2012 @03:09PM (#4200518)
Choosing the "best" platform for the client has both a technical aspect and a financial aspect. In most cases that I've seen in my 20 year career we probably could have gotten the job done with nearly any technology. The choice was ultimately down to whatever platform was most comfortable for the developers or, to be honest, just plain snobbery on the part of one or more of the team.

Of course there may be an ideal platform from a technical sense. I may have a project and I decide that it's 100% ideally suited for Scala. Using PHP may be only 85% ideal. However, is that really best for the client? Are they going to be forced to blaze new trails for things that are already solved in PHP? Is the client going to be able to find Scala developers when we leave? How about in 5 years? How much are they going to pay for that? Is it worth the 15% of efficiency that was gained?

There is no real correct answer here, but I guess my point is that when you are talking about what's "best" for the client, it's not always just a technical question.

Re:PHP is much better than what you think by aib on Wednesday July 04, 2012 @05:41AM (#4198624)
Well, yes, but awkward clients are still clients (read: people who give you money). Some of the consequences of the mentioned effect are that you may be forced to work with awkward clients or employers, or make otherwise awkward decisions.
Re:PHP is much better than what you think by anonymous on Wednesday July 04, 2012 @05:18AM (#4198533)
How many of those jobs are for maintaining old PHP codebases written way back when, though? Basically, what is the ratio of "PHP the sexy web framework" to "PHP the new COBOL"-type of jobs. I can't imagine it's even close to 1.
Re:PHP is much better than what you think by Kudos on Wednesday July 04, 2012 @05:50AM (#4198664)
Most of the jobs I interviewed for back then involved new development. The job I ended up taking turned out to be a ground-up rewrite of a consumer website (which sold for ~€250mm the week after I joined) to bring it from poorly designed PHP4 to better designed PHP5.

Why did they choose to do this in PHP instead of a more respected language? They already had a bunch of PHP developers.

Re:PHP is much better than what you think by xd on Wednesday July 04, 2012 @08:51AM (#4199171)
"PHP's most ardent advocates have little hands-on experience..."

And from what I've been seeing, PHP's most ardent critics have little hands-on experience with PHP, itself.

Edit: see this http://news.ycombinator.com/item?id=4198900 current rambling nonsense I'm having to contend with.

Edit edit: the voting is up and down, I can only assume that ~ 50% of this community just don't care about facts and would rather subscribe to witch hunts.

Re:PHP is much better than what you think by papsosouid on Wednesday July 04, 2012 @09:25AM (#4199317)
Yeah, sure seems like this guy has no clue about PHP alright: http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-de...
Re:PHP is much better than what you think by xd on Wednesday July 04, 2012 @09:31AM (#4199338)
And I guess this guy doesn't either: http://news.ycombinator.com/item?id=4177516
Re:PHP is much better than what you think by papsosouid on Wednesday July 04, 2012 @09:34AM (#4199353)
He seems like he does. You might notice I never said no PHP apologist understands PHP, but rather contradicted your (frequently posted) lie that PHP detractors don't understand PHP. Of course, he doesn't offer an actual rebuttal to much, mainly just "well yeah it sucks, but I know it sucks so its ok".
Re:PHP is much better than what you think by xd on Wednesday July 04, 2012 @09:36AM (#4199359)
"well yeah it sucks, but I know it sucks so its ok"

Sorry, but I really don't see how you got to that assumption. Can you enlighten me to what you are seeing that I'm not?

Re:PHP is much better than what you think by papsosouid on Wednesday July 04, 2012 @09:50AM (#4199393)
Read the thread, it isn't like his post went without responses.
Re:PHP is much better than what you think by xd on Wednesday July 04, 2012 @10:32AM (#4199547)
In response your undefined edit: Can you point out my lies?
Re:PHP is much better than what you think by papsosouid on Wednesday July 04, 2012 @10:54AM (#4199617)
Is this a joke? I made it pretty clear, and you know that is what I responded to. Quoth you:

>PHP's most ardent critics have little hands-on experience with PHP, itself

Re:PHP is much better than what you think by InclinedPlane on Wednesday July 04, 2012 @05:31AM (#4198594)
Flawed and good are not mutually exclusive. I'm no fan of PHP but I have to give it props. It is a legitimate web platform. No other term is more accurate to describe a tool that is used to drive literally billions of dollars in business and to host content viewed by literally hundreds of millions of users every single day.

PHP is out there. Being put to serious work. If you truly believe that PHP is a terrible and horribly broken tool the most dangerous mistake you could make is imagining that PHP doesn't serve as the backbone of much of the web.

Re:PHP is much better than what you think by notinfinland on Wednesday July 04, 2012 @05:30AM (#4198586)
What do you mean by "more full-featured alternatives". To me the main webdev languages look about the same when it comes to the major features that have a noticeable impact on a project. e.g: few projects are affected by the lack of closures

And all the talk about real this and real that. I don't think projects become more real when they're written in Ruby or Clojure. They're real when they work and are useful to the customers...

Re:PHP is much better than what you think by freshhawk on Wednesday July 04, 2012 @03:44PM (#4200647)
> To me the main webdev languages look about the same when it comes to the major features that have a noticeable impact on a project. e.g: few projects are affected by the lack of closures

Someone needs to read Paul Graham's essay about "the blub paradox"

I can tell you that the quality and ease of use of your web framework/libraries is highly affected by the lack of closures and other higher level language features. Even if you don't use them, your library developers have more tools and more flexibility.

Re:PHP is much better than what you think by astrodust on Wednesday July 04, 2012 @11:56AM (#4199834)
Malaria is everywhere. It's got to be awesome.

That PHP is so omni-present is not a good thing. It's an opportunity to disrupt web development. It's a lesson that we still haven't learned.

Re:PHP is much better than what you think by illumen on Wednesday July 04, 2012 @04:49AM (#4198427)
Facebook.
Re:PHP is much better than what you think by tikhonj on Wednesday July 04, 2012 @05:03AM (#4198476)
Yes. And now Facebook is spending a ton of resource and man-hours programming around this. They had to write their own compiler!

Also, I think they are trying to move away from PHP as quickly as possible without rewriting the entire site. The new projects and tools are not in PHP; moreover, I think most of the new people they hire never have to use PHP at all.

Finally, just because they managed to use PHP to run a bit site does not mean it is the best web language, or even a good web language. It just means it's adequate.

Re:PHP is much better than what you think by InclinedPlane on Wednesday July 04, 2012 @06:21AM (#4198747)
You get the same issues almost no matter what you write a website in, whether it's PHP, C#, Rails, or node.js. When you get to the level of scale that Facebook is at you are in a realm that conventional web application tooling and frameworks don't cover. If anything the "best" and most trusted platform for what facebook is doing today would be java. Does that mean java is the "best" web platform? Not in the least.

The central fallacy here is imagining that one size could or should fit all, whether it's php or rails or anything.

Re:PHP is much better than what you think by rimantas on Wednesday July 04, 2012 @06:22AM (#4198749)

  > Yes. And now Facebook is spending a ton of resource and
  > man-hours programming around this. They had to write
  > their own compiler!
Is there a project of Facebook scale which does not have "their own" at the very core, no matter initial choice of technology? My understanding is that by solving problems no one had to solve before you are bound to create "your own" stuff. Even for desktop — didn't Excel have it's own compiler?
Re:PHP is much better than what you think by notinfinland on Wednesday July 04, 2012 @05:20AM (#4198540)
Do you have inside info on this? I've seen several people from Facebook comment that they are in fact using PHP.

The fact that they're compiling to C++ is a consequence of the slowness of the programming language implementations of those languages that are used traditionally for web development. AFAIK Ruby was and still is the slowest of the bunch.

Re:PHP is much better than what you think by tikhonj on Wednesday July 04, 2012 @05:27AM (#4198573)
A couple people I know well spent the summer there (I actually visited one at the old headquarters; it was pretty cool). One now works there full time (the other hasn't graduated yet). I also talked to some fulltime engineers who were not using PHP.

Now, it's reasonable that I did not get the full picture, but the people I did talk did not use PHP themselves and claimed that new projects didn't either. Perhaps this varies per team. My impression was that existing code bases using PHP were still under active development (that is, getting new features) but new projects and new developers did not use PHP.

Re:PHP is much better than what you think by notinfinland on Wednesday July 04, 2012 @07:44AM (#4198953)
Interesting. What were they using, C++? I've heard about D...
Re:PHP is much better than what you think by tikhonj on Wednesday July 04, 2012 @03:12PM (#4200537)
The particular people I talked to were using C++. But I think there is even a team using Haskell for some internal tools :).
Re:PHP is much better than what you think by charliesome on Wednesday July 04, 2012 @06:17AM (#4198739)
MRI Ruby is actually significantly faster than CPython these days.
Re:PHP is much better than what you think by irahul on Wednesday July 04, 2012 @07:02AM (#4198829)
Citation needed. Both CPython and MRI are slow - if you need computational speed, use something else. But when your are comparing them to each other, CPython is faster. I don't know where you are getting that significantly faster bit from.

Since most benchmarks are unscientific, this one is as good as any. So here goes:

http://shootout.alioth.debian.org/u64q/benchmark.php?test=al...

Re:PHP is much better than what you think by chrisrhoden on Wednesday July 04, 2012 @09:05AM (#4199241)
I suspect that parent was referring to the python 2.x branch, which has been catching up with ruby 1.9, but on most benchmarks started at ~ 3x slower and are now ~ 2x slower.

Since benchmarks are completely worthless, let's just stop this pissing match right now.

Re:PHP is much better than what you think by irahul on Wednesday July 04, 2012 @09:19AM (#4199287)
> I suspect that parent was referring to the python 2.x branch, which has been catching up with ruby 1.9, but on most benchmarks started at ~ 3x slower and are now ~ 2x slower.

Citation needed again. Ruby 1.9 is slower than Python 3, and Python 3 is slower or as fast as Python 2 on Python official benchmarks.

http://docs.python.org/release/3.0.1/whatsnew/3.0.html#perfo...

> Since benchmarks are completely worthless, let's just stop this pissing match right now.

Benchmarks are far from worthless. And pissing match? Asking for citations amounts to pissing match? The parent claimed something that isn't true(ruby 1.9 significantly faster than CPython - that has never been the case). And you are adding python 2.x was slower than 1.9, when 2.x is generally faster than 3.

I love ruby as much as the next guy. But when it comes to execution speed, ruby has always been the slowest among ruby, python, and perl.

Re:PHP is much better than what you think by chrisrhoden on Wednesday July 04, 2012 @09:59AM (#4199425)
Fib(36)

Python 2.7.2

    def fib(n):
        if n == 0 or n == 1:
           return n
        else:
           return fib(n-1) + fib(n-2)
     
     for i in range(36):
         print "n=%d => %d" % (i, fib(i))'
python -c 20.69s user 0.06s system 99% cpu 20.807 total

Ruby 1.9.3 def fib(n) if n == 0 || n == 1 n else fib(n-1) + fib(n-2) end end

    36.times do |i|
      puts "n=#{i} => #{fib(i)}"
    end
ruby 11.44s user 0.03s system 99% cpu 11.507 total

I guess since benchmarks are not completely worthless, we should conclude that ubuntu doesn't keep up on ruby and uses 2-3 year old versions.

I wasn't accusing you of starting the pissing match.

Re:PHP is much better than what you think by irahul on Wednesday July 04, 2012 @11:13AM (#4199694)
> I guess since benchmarks are not completely worthless,

The original keeps getting re-iterated: http://programmingzen.com/2007/11/28/holy-shmoly-ruby-19-smo...

The original author, on a basis of a fib benchmark, concludes ruby 1.9 is faster - that is as flawed as it gets.

Did you try running with Python 3? You will get around the same time as you get with Python 2.7. Pick anything from here http://shootout.alioth.debian.org/u64q/benchmark.php?test=al... and run it with Python 2.7 and ruby 1.9. The programs which are faster with Python 3 will be mostly faster with Python 2.7. 2.7 isn't slower than ruby 1.9; it is faster in most of the cases.

Regarding the fib example, when the original was doing the rounds, I didn't find any explanations from python or ruby implementors. I can't say why, but most likely python has a higher overhead with growing call stacks, and ruby does some optimizations.

Re:PHP is much better than what you think by slurgfest on Wednesday July 04, 2012 @10:49AM (#4199597)
Data is not dishonest and benchmarks are not dishonest. What is dishonest is this tendency to cherry-pick only the case which is convenient to you, as you have done here. If you want to talk about Ruby performance vs. Python then you will have to dig into something like the site linked previously, which has many different benchmarks run on a uniform testbed rather than a single cherry-picked case run in whatever way you felt like.
Re:PHP is much better than what you think by igouy on Wednesday July 04, 2012 @12:18PM (#4199916)
>>ubuntu doesn't keep up on ruby and uses 2-3 year old versions<<

Huh? Since 21 Apr 2012, the benchmarks game has shown - ruby 1.9.3p194 (2012-04-20 revision 35410).

Re:PHP is much better than what you think by igouy on Wednesday July 04, 2012 @01:06PM (#4200107)
If you're looking at measurements made on the quad core machine, then remember to check the "≈ CPU Load" column to see whether some programs are using multiple cores and some programs are only using one core.

When the comparison would be better without that complication, look at single core measurements -- http://shootout.alioth.debian.org/u64/benchmark.php?test=all...

Re:PHP is much better than what you think by igouy on Wednesday July 04, 2012 @12:58PM (#4200071)
>>Since most benchmarks are unscientific, this one is as good as any.<<

1) You seem to be using "unscientific" as a nothing more than an insult.

2) Your conclusion "this one is as good as any" doesn't follow from your premise that "most benchmarks are unscientific" -- "this one" might well be different from "most benchmarks".

3) If your conclusion was correct then that wouldn't mean that the benchmark was good, just that it was also bad.

Re:PHP is much better than what you think by irahul on Thursday July 05, 2012 @01:45AM (#4201882)
>>Since most benchmarks are unscientific, this one is as good as any.<<

>1) You seem to be using "unscientific" as a nothing more than an insult.

More like preemptively declaring I don't want to deal with HN crowd replying with "but benchmarks are worthless".

> 2) Your conclusion "this one is as good as any" doesn't follow from your premise that "most benchmarks are unscientific" -- "this one" might well be different from "most benchmarks".

IMO shootout benchmarks are better than random benchmarks on the web as they detail the testing environment, provide the source code and can be re-created

Re:PHP is much better than what you think by igouy on Thursday July 05, 2012 @01:37PM (#4203985)
>>More like preemptively declaring I don't want to deal with HN crowd replying with "but benchmarks are worthless"<<

It's a dirty job but it still has to be done ;-)

Let them reply and then answer them.

Re:PHP is much better than what you think by nbm on Wednesday July 04, 2012 @02:30PM (#4200367)
I have only a year and a bit of context since starting at Facebook, but here's my viewpoint.

Facebook isn't trying to move away from PHP as quickly as possible. For years, there have been PHP components (primarily web front-end rendering, aggregation/ranking of data from various sources) and C++ components (primarily high-performance back-end services) and other languages like Python (primarily non-production-path/operations back-end services) and Java (primarily Hadoop-related technologies like Hive and HBase, and services that are heavy users of such), and nothing groundbreaking has changed in this.

New hires use PHP or C++ or whatever language (and often multiple languages) necessary to work on the team and projects they choose to work on. New projects use the languages that make the most sense.

Almost all web front-end work involves PHP - the frameworks and libraries and runtime environment are well-developed, well-tested, well-documented, and well-known.

In terms of HipHop for PHP, the question to ask is: What language could have allowed quick low-barrier-to-entry web-app-centric development in the early days while still delivering the sort of runtime efficiency demanded by the environment? Languages like Python and Ruby may arguably allow the first (but remember we're talking about early 2004 here, so Ruby on Rails was not out, and neither were Django, Flask, and so forth and WSGI had just come out), but would have required a "HipHop for PHP"-style solution as well. Languages like C, C++, and Java may have the runtime efficiency, but it would be a hard argument to say they're as developer-time-efficient as PHP (especially back then).

That's a slightly different question to what one should do today if starting a new venture. And _that_ is also a different question to what Facebook should do today - HipHop for PHP exists, and is delivering performance/runtime efficiency that most languages people mention as an alternative do not. And, the PHP frameworks and libraries and runtime environment exist and allow rapid development of production code. It's actually reasonably pleasant to develop for with those in place.

The HipHop for PHP team is small, but have huge leverage - this small team of reasonably hardcore low-level C++ programmers are making a whole bunch (hundreds?) of PHP developers way more productive (since they don't have to use a relatively slower-to-develop-in language/runtime like C++), and also makes the cost of operating the site go down by making that code more efficient and reducing the number of servers needed.

Re:PHP is much better than what you think by Kudos on Wednesday July 04, 2012 @05:12AM (#4198500)
The same argument could be made of Ruby on Rails, just look at Twitter moving core infrastructure to the JVM.
Re:PHP is much better than what you think by tikhonj on Wednesday July 04, 2012 @05:14AM (#4198506)
It could, and I think it should. I am no fan of Rails. But that is a different story for a different time.
Re:PHP is much better than what you think by illumen on Wednesday July 04, 2012 @05:24AM (#4198561)
The Face Book.
Re:PHP is much better than what you think by davidlumley on Wednesday July 04, 2012 @04:56AM (#4198451)
I keep hearing people mention Facebook as a reason why PHP is a great development language but they compile it down to C++ using their HipHop compiler, and from what I understand they develop Facebook _in spite of_ PHP ( http://www.quora.com/Do-Facebook-engineers-enjoy-programming... )
Re:PHP is much better than what you think by nicholassmith on Wednesday July 04, 2012 @05:55AM (#4198679)
I got downvoted on another PHP related thread here for bringing that up. Can you truly say they use PHP when they've invested a hell of a lot of money into HipHop to essentially allow devs to write additional PHP code and transform it into C++ binaries? It's a strange way of using it for sure, but it seems to be effective for them.
Re:PHP is much better than what you think by memla on Wednesday July 04, 2012 @06:32AM (#4198768)
Right, but Facebook supposedly receives 1 billion new comments + a couple billion likes + a couple hundred million status updates daily, and is probably the largest photo sharing site on the net. Twitter gets about 200 million tweets daily and Reddit has 250 million comments total. Disqus is not much larger than Reddit.

So, since most people here are suggesting Python or Ruby, what real world example can we provide that compares to Facebook in order to make sure that these languages would perform better than PHP?

Neither Twitter, nor Reddit or Disqus are exactly the most stable and performant sites out there. So?

I would say that quick and dirty comparisons like this are meaningless.

Re:PHP is much better than what you think by lars512 on Wednesday July 04, 2012 @09:12AM (#4199263)
Google is the real-world example of Python deployment you're looking for, although we don't have the full details of where it begins and ends in their no doubt complex stack. So again, the comparison isn't that useful.

Talking about what languages programmers find enjoyable and productive is perhaps more meaningful. This is where Python and Ruby shine, and PHP falters.

Re:PHP is much better than what you think by Kudos on Wednesday July 04, 2012 @06:23AM (#4198752)
Yes, you can truly say they use PHP. You are confusing the language and the interpreter. I've seen Facebook engineers comment on threads like this and say the same thing I just have.
Re:PHP is much better than what you think by tijs on Wednesday July 04, 2012 @04:55AM (#4198448)
And just because a big site uses it the language does not become good either, see the availability argument. I think most PHP programmers would not recognize what's running at Facebook as PHP with all the customization they have done.
Re:PHP is much better than what you think by drivebyacct2 on Wednesday July 04, 2012 @04:52AM (#4198434)
I very specifically didn't say that PHP couldn't be used to build real products, but that still doesn't (at least on it's own) make it good or make it the best.
Re:PHP is much better than what you think by illumen on Wednesday July 04, 2012 @04:53AM (#4198441)
I guess the worlds most popular websites, and the vast millions of PHP programmers must all not really exist. They can't exist, and can't be making good stuff, because PHP is just doesn't work.

Here is a list of template languages people on 'real' platforms use:

Python.

Airspeed, Castalian, Chameleon, Cheetah, CubicTemp, Django template system, Elements, EmPy, Evoque, HRL Powerful macro preprocessor for HTML, Genshi, Jinja 2, Mako, moody-templates, Myghty, Qpy, PML, pyratemp, Spyce, SUIT, Tempita, Tenjin, Template Toolkit, Templite+, thrases, ClearSilver, HTMLTemplate, JonsPythonModules, meld3, PyMeld, Pyxer, pso, Sprite, teng, webstring, XSLTools, PyPa, Genshi, kajiki, htmltmpl, Kid, SimpleTAL, CherryTemplate, AsciiDoc, Markdown, PyTextile, ReStructuredText, txt2tags, PottyMouth, Creole,

Ruby.

Radius. HAML. cs/Template. ERB, eRuby, Erubis, Galena, Tenjin, Liquid Markup. Ruty, PageTemplate, Amrita, Amrita2, Kwartz, Markaby. Maline. Builder::XmlMarkup, RedCloth, BlueCloth, RSmarty, Tempura, TAL, Curtis / Punk, Erby, RBML, RTALS, Tie, RVelocity, RailTags,

Java.

FreeMarker, SiteMesh, StringTemplate, Tea, Better Templates for Everybody, jxp, LSP, JCopist, Dynamator, RTFTemplate, Velocity, JByte, Jamon, JDynamiTe, WebMacro, Viento, IKAT, Bluprints, Transformica, Hapax, MiniTemplator, Xtempore,

_Not a complete list._

PHP is a pretty good template language, with pretty amazing documentation.

To deploy, you just upload a file.

You could walk outside now, and start yelling "I NEED A PHP PROGRAMMER!" and you'd probably find someone pretty quickly.

There are millions of hosts to choose from at tiny prices, who can provide support because they know the platform.

Re:PHP is much better than what you think by talkingquickly on Wednesday July 04, 2012 @05:00AM (#4198469)
Saying PHP is good because Facebook use it is kind of like saying phone hacking is good because it was utilised but some of the UK's most popular newspapers...

I'd be interested to know if there's any commentary from people high up in Facebook on whether they'd use PHP again if they were starting now?

Re:PHP is much better than what you think by jfarmer on Wednesday July 04, 2012 @05:14AM (#4198511)
Look at Quora, Path, and Asana, the three most successful consumer startups started by former Facebookers.

None use PHP.

Re:PHP is much better than what you think by illumen on Wednesday July 04, 2012 @05:44AM (#4198638)
Never heard of them.
Re:PHP is much better than what you think by irahul on Wednesday July 04, 2012 @07:07AM (#4198842)
You are deliberately trying to miss the point. But in the off chance that you don't really get it, the point is quora, asana were started by early facebook programmers, and they didn't use PHP. If they liked PHP so much, they would have used it.

I can't find a citation, but there was a thread where a fb engineer claimed fb's internal PHP wiki starts with "There are two kind of people. People who hate PHP, and people who don't use PHP."

Re:PHP is much better than what you think by maratd on Wednesday July 04, 2012 @10:32AM (#4199545)
> If they liked PHP so much, they would have used it.

Or they got tired of being bullied by people like you.

Re:PHP is much better than what you think by irahul on Wednesday July 04, 2012 @11:18AM (#4199712)
>> If they liked PHP so much, they would have used it.

> Or they got tired of being bullied by people like you.

Or they really aren't a fan of PHP?

http://www.quora.com/Quora-Infrastructure/Why-did-Quora-choo...

Re:PHP is much better than what you think by jfarmer on Wednesday July 04, 2012 @05:59AM (#4198690)
And that's relevant how?
Re:PHP is much better than what you think by nivla on Wednesday July 04, 2012 @05:24AM (#4198563)
What kind of an analogy is that? It is not only flawed but does not relate to your argument. I guess the point that illumen was trying to make is that PHP can be used in popular real world applications and is "proven" to scale. Just like Facebook, you can look at Wikipedia, Wordpress, Tumbler or earlier days of Youtube all of which was/is written in PHP!

Be comfortable with the language you prefer and quit whining about the rest!!!

Re:PHP is much better than what you think by talkingquickly on Wednesday July 04, 2012 @05:41AM (#4198623)
In no way whining about PHP, I still maintain various projects which use it and for which I think it's well suited.

The analogy was only meant to demonstrate an objection to arguments along the lines of "it's used by something popular therefore it's good" or "lots of people use it therefore it's good" which seem to be common points put forward in favour of PHP.

Popularity/ use by someone popular may be an indicator of quality but it very often isn't, the analogy isn't intended to go any further than that!

Re:PHP is much better than what you think by tomelders on Wednesday July 04, 2012 @05:14AM (#4198507)
No, it's nothing like that.
Re:PHP is much better than what you think by papsosouid on Wednesday July 04, 2012 @09:29AM (#4199328)
There is such commentary from people who left facebook to do their own thing. They did not use PHP. http://www.quora.com/Quora-Infrastructure/Why-did-Quora-choo...
Re:PHP is much better than what you think by slurgfest on Wednesday July 04, 2012 @09:14AM (#4199273)
I guess your point is that there are too many options. But you have artificially inflated the count as you have made this point. Most of the things you have listed are not applicable (either not used any more, or are not general and were never used to compose full HTML pages). Cut out the ones which are not actively developed and you only have a handful for each language.

Since the problem seems to be that you need someone to choose for you: use Django on Python, use Rails on Ruby, and for each one use the templating that comes with it. If you switch to another framework, use its templating language. If you are advanced enough to use a microframework then you are advanced enough to plug in Jinja2 or whatever it is you really want.

Django, Rails, and Jinja2 have excellent documentation. I can't understand why you would think that PHP's documentation is significantly better.

You get what you pay for on super-cheap hosts who are somehow incompetent to understand Python or Ruby.

And choice is not a bug.

Re:PHP is much better than what you think by ceejayoz on Wednesday July 04, 2012 @01:28PM (#4200173)
> Cut out the ones which are not actively developed and you only have a handful for each language.

"The template language you pick has a good chance of becoming an abandoned project" hardly seems a great selling point.

Re:PHP is much better than what you think by greyfade on Wednesday July 04, 2012 @11:49PM (#4201669)
> You could walk outside now, and start yelling "I NEED A PHP PROGRAMMER!" and you'd probably find someone pretty quickly.

This is something that I point out as a negative. Yes, you can get a PHP programmer just about anywhere. But being that there are so many, it's harder to find those few truly talented programmers.

My own complaint about this is that if you bring in cheap PHP programmers, you end up with cheaply-written PHP. And the result is inevitably an unmaintainable mess. If you want well-written, maintainable code, you have to be willing to hire talented and experienced programmers. And in doing so, you give up that so vaunted "advantage" of PHP's mindshare.

Moreover, it seems to me that the truly talented programmers that would produce good software have a tendency to distance themselves from PHP.

So it seems to me: Choose PHP for cheap, quick projects on a budget for which quality is irrelevant; or choose a "harder" language for solid applications that will stand the test of customer interaction.

Re:PHP is much better than what you think by OyoKooN on Wednesday July 04, 2012 @05:15AM (#4198518)
Yeah. That's why they completety rewritten it...
Re:PHP is much better than what you think by drivebyacct2 on Wednesday July 04, 2012 @04:18PM (#4200740)
You literally just repeated all of the things that I just got done addressing. You also continue to ignore that I said NOTHING about PHP not being usable for "real sites".

I also, still, don't get your point. There are other templating languages for PHP too.

Again, your deployment argument is just as silly as your availability argument. It's trivial to deploy to Azure (sites) or Heroku, or Ironio or gondor, or any Go project, or etc, etc.

>There are millions of hosts to choose from at tiny prices, who can provide support because they know the platform.

Are you even reading what I write? Please show me a real webapp with actual users hosted on el cheapo shared hosting.

Re:PHP is much better than what you think by drivebyacct2 on Wednesday July 04, 2012 @04:59AM (#4198460)
To put my comments in another light, let me postulate this. If I started a project in python, Go, ruby, C# or even something that ran on the JVM, I could give reasons for why I would choose it for something non-trivial. Outside of "I can hire cheap devs" and "I can run it on el-cheapo hosting", I can't think of a good reason to specifically pick PHP.
Re:PHP is much better than what you think by illumen on Wednesday July 04, 2012 @05:27AM (#4198575)
Reducing the cost of your project is a pretty good reason to choose something. Which template language would you choose for those other platforms? One of 200 half-baked templating languages, or something more complete like php?

PHP has better documentation than all of those platforms, so that could be another reason. It has more advanced, popular, and featureful Content Management Systems than all of those platforms.

Re:PHP is much better than what you think by aviraldg on Wednesday July 04, 2012 @06:08AM (#4198721)
> "Half baked"

Meh. jinja.pocoo.org

> "better documentation"

By what measure? docs.python.org is just as good (if not better.)

Re:PHP is much better than what you think by Shish2k on Wednesday July 04, 2012 @07:51AM (#4198983)
Python docs are way better on a technical level IMO (more detailed, more accurate - if you want to know what a function does in PHP you need to spend hours reading through the massive comment threads to find the corrections, and then ignore the comments from years ago since the API changed and the comments didn't, etc etc); but much like the rest of PHP, the PHP docs are incredibly convenient - php.net/function_name will go direct to the docs for that function if it's unique, or search for function_name in all libraries if not.

This is really useful when your standard library is an incredible cockup of str_pos vs strpos vs string_pos vs sposition vs StrLib::Position vs ($haystack, $needle) vs ($needle, $haystack) - it means you only need to spend a few seconds double-checking the docs every time you use a standard library function.

Sure, a library which was consistent and thus needed no lookups at all would be better, but if you abandon all hope of making sense of it and understand that you'll need to use the documentation several times per line of code, the convenience of the docs makes it not quite so painful.

Re:PHP is much better than what you think by mfjordvald on Wednesday July 04, 2012 @09:21AM (#4199302)
No serious PHP developer actually go to php.net to read the documentation, literally all of the big PHP editors/IDEs come with an embedded manual so when you write strpos( it automatically tells you the order of variables.

If I really had to go to php.net to look up order of variables or even a function name then I wouldn't be programming in PHP at all, would take too long. Thankfully, since I'm not restricted to notepad I don't have to worry about this aspect.

Re:PHP is much better than what you think by sandis on Wednesday July 04, 2012 @01:24PM (#4200154)
You're basically saying that no serious PHP developers are using, say, VIM or Sublime Text, which is not true. I still hit php.net from time to time.
Re:PHP is much better than what you think by nobleach on Wednesday July 04, 2012 @06:00PM (#4200946)
Yeah, this is me too. I haven't done much PHP in the past year, but when I did, PHP.net was ALWAYS open in a tab or two. There was NO WAY you were gonna get me to use some bloated nasty Java based editor just to have code completion. Honestly though, Stackoverflow is my goto point if I want the better parts of php documentation comments. An answer with 7 or more votes is worth taking a look at.
Re:PHP is much better than what you think by mfjordvald on Saturday July 07, 2012 @04:08PM (#4212582)
Then you are needlessly torturing yourself, if that's your thing then go ahead, but yeah I'm being blunt and calling that stupid.
Re:PHP is much better than what you think by corford on Wednesday July 04, 2012 @06:26AM (#4198757)
Sorry have to quibble on that last sentence. I'm transitioning from PHP to Python at the moment and I constantly keep thinking "jesus, I wish docs.python.org was as good as php.net".
Re:PHP is much better than what you think by aviraldg on Wednesday July 04, 2012 @06:43AM (#4198793)
In what sense? I feel it's better than PHP's docs (tutorial, index, module list, everything.) Besides, you rarely ever need to look at the docs. `help(...)` works well enough 99% of the time.

Method and module names are clear and easy to guess. If I remember PHP well enough, it was a sorry_mess_of_underscored_function_names (with no namespaces) and had $funky $dollar $signs before variables. Some of the functions worked one way, some of them worked in another way (I mean that similar functions didn't work the same way.) Don't get me started on the type coercion system and the equality operators (among other things.)

EDIT: Quite a few people have mentioned that it's easy to deploy PHP software and while that might be true, (as I remember it from when I used to develop in PHP) it's much harder to set up a PHP environment than a Python one. Some of PHP.ini's defaults are (were) horribly broken, Apache has (had) problems finding PHP, etc. In contrast, setting up a Python/WSGI environment is like a breeze.

Re:PHP is much better than what you think by mercurial on Wednesday July 04, 2012 @07:05AM (#4198834)
It's better than PHP docs simply by virtue of being versioned and annotated with version information.
Re:PHP is much better than what you think by ceol on Wednesday July 04, 2012 @12:13PM (#4199898)
This link was right on the Python docs homepage.[0]

[0]: http://www.python.org/doc/versions/

Re:PHP is much better than what you think by corford on Wednesday July 04, 2012 @02:09PM (#4200296)
I miss the user contributed notes. I miss the way you can drill down on the left hand side of the screen. I miss the multitude of quick examples embedded alongside the documentation (py docs has some but not nearly as many). I find the descriptive language used more approachable and easier to understand. I also prefer the general look and feel.

To answer your second point about deployment: regarding your ini file, you set this up once how you want it to be and then use that across all your projects. Not very hard. As for apache, I don't know what you were doing but in my experience it's almost impossible for apache not to find php. I've just setup uWSGI (plus emperor) + mongrel2 + Flask (in a virtualenv) and that is 100 time harder to get going than apache and mod_fcgid (IMHO).

Re:PHP is much better than what you think by InclinedPlane on Wednesday July 04, 2012 @05:46AM (#4198646)
Shorten that. "I can hire devs". If you're just a small shop hiring a rails dev, let alone a Go dev, might be effectively impossible. Which is a very big deal for a company that relies on external contractors for a lot of their development, which is a fairly substantial group of small companies.