5 ms·
I don't see the point of HH. There are valid reasons to use php. IMO they are: A existing codebase and the fact it is installed everywhere. But HH is neither i
by fosap 13y ago
I don't see the point of HH. There are valid reasons to use php. IMO they are: A existing codebase and the fact it is installed everywhere.
But HH is neither installed everywhere nor will the old codebase be compatible. Why not use a proper language right from the start? There are tons of alternatives that do not suffer from the shortcomings hh tries to fix.
- deleted 13y ago[deleted]
- RobAley 13y agoEr, surely the whole point of the article is that they are making it so that more of the existing codebase will run. Their roadmap also includes making it easy to install on Linux and other platforms, so it may make inroads into "everywhere". If they can even achieve the first objective, then people can continue with the normal PHP runtime as usual in most places and switch to HHVM when they need better performance. Also, I find PHP a delight to program in. YMMV.
- jeffasinger 13y agoNewer PHP isn't too bad to program in, so long as everyone who ever will need to write a line of your code is relatively disciplined, and works to an agreed upon standard. However, your average codebase, written for PHP 5.0 or older, touched by many, mostly incompetent people over several years, is usually incredibly painful to work with.
- debacle 13y agoI haven't seen a PHP codebase that didn't run on 5.2 in years. If you don't support 5.2, that means your code is at least eight years old at this point, with no effort at all to upgrade. That's kind of scary. It'd be like captaining the SS Swiss Cheese.
- andyhmltn 13y agoSadly, I've seen companies that depend (like literally, if it were to fail the company would shut down) on a codebase that is on 5.0 :(
- astrodust 13y agoIf you find "PHP a delight" you'd probably love a language with a sane design even more.
- mildtrepidation 13y agoAs someone who did make such a change, I agree with this. I'm assuming the parent did not intend it as trolling, as I don't.
- astrodust 13y agoI wish there were more stories of people who've gone "post-PHP", talking about their experiences. "PHP developers", by which I mean developers that know PHP and PHP only, are the first to throw a fit when their language is criticized. This is especially awkward as most PHP developers don't even observe best practices for developing with PHP, insisting on using obsolete versions, write hazardously bad SQL queries with so much moaning about how it's not a big deal, and get absolutely irate when you suggest they use an application platform instead of rolling everything by hand. There's something to be said for using a language where the community encourages people do to it properly, and everyone's trying to make an effort to move forward together.
- jcroll 13y agoThe PHP community is moving forward and trying to do things the right way. Checkout http://www.phptherightway.com/ http://www.phptherightway.com/ Also checkout the Symfony components and how many large open source PHP projects are using them: * Symfony Framework * Drupal * Laravel * Silex * phpBB * Guzzle Then there's Composer (which also uses Symfony components) and PHP-FIG. The list goes on. What you need is more modern PHP developers advocating on boards like HN how good PHP has become, not how much better other ecosystems are than what PHP was five years ago.
- astrodust 13y agoA small fragment of the PHP community is doing things better than the rest, but it still seems like there's a lot of untamed wilderness out there. StackOverflow is filled with people who've suffered badly at the hands of w3schools and various atrocious YouTube tutorials which perpetuate the absolute worst practices from the 1990s. Perhaps the problem isn't having good resources so much as getting rid of the bad ones. PHP still has a long, long way to go. The rampant infighting in the core team, the completely incoherent API and language design, the lack of innovation on core libraries, none of this is very encouraging.
- michh 13y agoDon't forget the fact that PHP devs are relatively cheap. Especially compared to people capable and willing to learn your brand new homegrown language.
- twistedpair 13y agoAnd the truth comes out.
- astrodust 13y agoPython, Ruby, C#, and JavaScript are "homegrown" now?
- michh 13y agoNo but people were suggesting that if they're writing their own VM, they might as well design a better programming language to use on it.
- jcroll 13y agoThe shortcomings it tries to fix is the speed of the execution of the language, something PHP already gets better than other dynamically typed languages such as ruby. There's lots of good reasons to pick PHP as the language to develop A web application on and with HHVM in the mix the reasons will be greater still. PHP is a real programming language, if your greatest knock against it is the inconsistent order of function parameters then I don't really think you do have a knock against it unless of course you want to take the same swipe against C.
- maximilianburke 13y agoFor projects the size of Facebook there's a lot of risk and not a lot of reward in rewriting the whole site. Instead of retraining all their developers to write in a new language and taking the time to stop all current development and begin the rewrite, they were able to have a few guys go off and make the current infrastructure faster. If you have a sizable existing PHP codebase time and money would be better spent making it run on HHVM than rewriting it in another language, especially if you have an existing army of PHP developers.
- AsymetricCom 13y agoWhat are valid reasons to use PHP? Like, you don't care about your code or you have no availability SLA?
- Joeri 13y agoIt's a great language for quick prototyping or doing sysadmin tasks (i would choose php over any shell script language any day). I also see no evidence that php apps in practice are any less reliable. Php is in fact probably more reliable because it doesn't give you dangerous stuff like multi-threading and because its very forgiving of errors (it doesn't consider an error a good reason to stop running code).
- yareally 13y agoAlthough it's not a feature that appeals to everyone, modern PHP (5.4+) has nearly any sort of syntactic/structural feature one would want in a programming language, except enumerations[0]. After using them in Scala, traits are also a nice plus to have in PHP. I do use PHP less than I used to, opting for Python more as it has more uses than PHP does (PHP can be used with GTK or CLI, but no thanks) outside of the web. There are also quite a few good libraries and frameworks out there for PHP, although they're hard to find if you're not already experienced in PHP and can filter out the horrible ones by reading their code. Compared to Python, the task of finding quality code is generally harder from all the existing stuff out there holding on to bad hacks from PHP 5.2 and before (as well as long time PHP developers abusing such bad hacks out of habit). Also, in PHP, trying to do anything event related with server to client notifications[1] comes down being an ugly hack[2] unless you want to use some third party PHP extensions like libevent[3] or offload to another language/service you could have just written everything in to begin with. PHP is just not built for anything unconventional like that and makes your life a headache if you ever find you need it at some point. Screwing with all of that is way more of a pain than just using Python with Tornado or Twisted, using Node.js or something like Play 2.0 with Scala. For what it's worth, the MySQLi native driver/api supports non-blocking async queries to the DB at least now and the native PostgreSQL API does as well (albeit the PgSQL API is not Object Oriented and I resorted to wrapping it a class that mimicked the MySQLi Object Oriented API for consistency). [0] http://marc.info/?t=132988607800003&r=1&w=3 http://marc.info/?t=132988607800003&r=1&w=3 (lots of futile rants about it here). Basically comes down someone rejecting enum because they claim it's "redundant" (though PHP has plenty of previously accepted redundancies) when you can fake them with classes (which is not true as you cannot use them in a switch [without faking with toString()] and cannot use them without instantiating an object). The other excuse is it would introduce "strict typing creep" to PHP, which is silly, since you can already type hint on functions by including a the class or array type in each parameter (and will even throw an error if using the incorrect type). Excuses are not surprising though, given the news the past month of how toxic the core developer mailing list is for PHP. [1] http://ajaxpatterns.org/HTTP_Streaming http://ajaxpatterns.org/HTTP_Streaming [2] To implement in PHP without event listeners, you have to use some sketchy third party php based http servers instead of fcgi+fpm for those parts or fake it with an infinite loop + sleep and use nginx + http push stream (http://wiki.nginx.org/HttpPushStreamModule http://wiki.nginx.org/HttpPushStreamModule) [3] http://php.net/manual/en/book.libevent.php http://php.net/manual/en/book.libevent.php