6 ms·
The only advantage of using PHP in my eyes is: incredible cheap and hassle-free hosting for beginners. If you change something when introducing HHVM to the mass
by anonyfox 13y ago
The only advantage of using PHP in my eyes is: incredible cheap and hassle-free hosting for beginners. If you change something when introducing HHVM to the masses, then you would have a game-breaker.
If you can afford/achieve anything better than "drag'n'drop" your "index.php" there, and open your browser to "test if it works", do it.
Except, of course, you have to maintain tons of legacy stuff already written in PHP.
- Keyframe 13y agoI can give you two more advantages. Lots of know-how available and lots of developers to pool from.
- mathgladiator 13y agoAnother: it's really-really easy. I've built frameworks, done ruby, django, prior to my Java days. And, wow, php is just sooo easy to iterate and play with.
- coldtea 13y ago>The only advantage of using PHP in my eyes is: incredible cheap and hassle-free hosting for beginners. Well, clearly the engineers working on Facebook's PHP (and several other large projects, from Yahoo! to Wordpress.com) aren't "begineers" neither looking for "cheap, hassle-free hosting". I don't buy the "it's so crap, it's ONLY used because of cheap hosting" argument. It's also a pragmatic language, with tons of libraries and features for web use. So, it might be far from perfect, but than again, Javascript is far from perfect too, C++ is also flawed and Java has tons of bad decisions in its design (and culture). Still, those are some of the more widely used languages.
- anonyfox 13y agoFacebook just can't "switch" their backend. The mountain of built PHP stuff, including HHVM, is just too big to give up. They're of course not the typical beginners, but it's really easy to "get shit done" in PHP, so it happened that they used PHP when it all exploded in popularity, and mostly had to think on how to scale a running system massively, and not to rewrite everything from scratch again. On the libraries side: compare with javascript... all the NPM stuff and frameworks out there, and all the clientside-libraries in addition (think alone jQuery plugins). There is much crap in the JS-Land, but the sheer amount beats PHP clearly i'd say. Or take the JVM: the VM is a masterpiece of engineering/programming and has a lot of libraries availably, not only for web stuff, and supports many languages on top of it. Or, if you have some experience in the .NET world and know your visual studio, you can literally drag'n'drop your website together out of layouts and components. So far you can't share PHP code seamlessly between server & client (-> JS), your runtime doesn't run quite everywhere and allows you to use the language you like (-> JVM) or is preinstalled on every windows system today and has an excellent visual development tool (-> .NET). Yes, every language and ecosystem has it's flaws, but mostly they have also some single strengths that outweight the disadvantages. When you must nail down what PHP's is: I say incredible cheap hosting, and tons of legacy stuff (ironically often dropped on shitty cheap hosting platforms). You may find more stuff pro/con for all the samples i mentioned above, but i hope you understand the core problem.
- cpeterso 13y agoUnless the Facebook backend is a giant monolithic service, they seemingly could have used a loosely-coupled service-oriented architecture and rewrite individual services in some new language or platform. That's how Twitter migrated from Ruby to Java.
- lmm 13y ago> So, it might be far from perfect, but than again, Javascript is far from perfect too, C++ is also flawed and Java has tons of bad decisions in its design (and culture). Still, those are some of the more widely used languages. Still, I wouldn't take a job in any of them. Javascript is crap, only used because it runs in the browser. C++ is pretty crap, only used because it has manual memory management. Java has its problems, but it has a decent design at least for the time; there is a terrible culture that I think adopted Java because it was popular rather than the other way around. But yeah, in 2013 there are really much better languages than PHP available; if you want a similar-feeling replacement Python or Ruby are much saner, if you're willing to step further afield there are wonderful modern languages that push the boat a bit further (I'm in love with Scala at the moment).
- justinhj 13y agoDefine 'better'. Personally I think Clojure has a lot going for it, and it's better than a lot of languages in a many ways. However, for the kind of application I work on PHP is significantly better fit than Clojure. Most of the points made in this talk apply to my situation. http://www.infoq.com/presentations/php-history http://www.infoq.com/presentations/php-history
- lmm 13y agoThe main "better" I care about is "fewer gotchas and special cases to memorize"; that's not the only thing that matters about programming languages, but it's a big factor. I don't have time to watch a 40-minute video; arguments I remember hearing from something similar are the very fast coding feedback cycle (easy with modern-day rails/django/etc.), "it's better than it used to be" (not really an argument), availability of frameworks (but I've never seen an actual example of the advantages that you don't get in other languages/frameworks), large standard library (again, present in other languages), dependency management (which seems more like php catching up with other languages than overtaking them), deployment (may have been a good argument in the pre-wsgi days and when Apache was the only webserver around, but not true any more IMO). What is it you see PHP as better than ruby/python at?
- MichaelGG 13y agoThe engineers working on FB's PHP have reimplemented the runtime. I doubt that was a bonus or a reason they considered PHP. I find it highly unlikely anyone started off using a platform with the goal of "we get to completely re-implement this platform because it will not work for us otherwise."
- coldtea 13y agoThat's a flawed argument. The only reimplemented the runtime to get better performance, for their humongus needs. The PHP semantics and language remain the same. So, them re-implementing the runtime is no more an argument against PHP than using PyPy instead of CPython or JRuby instead of MRuby is. Not to mention that have they been using say Ruby instead of PHP, they'd have the same, or even worse, problems regarding getting the most performance out of their runtime. So this is totally orthogonal to the issue of PHP's merits -- only has to do with performance, so the same things could have been said for Python or Ruby that are in the same ballpark as PHP in this area.