Live data from Hacker News

PHP needs to die. What will replace it?

seldo.com

61–70 of 160 posts

Re: PHP needs to die. What will replace it?

#61

One word: deployment To me, the best thing about PHP is that it is so easy to deploy to pretty much any shared hosting on the planet, not to mention really easy to set up on your local machine (with WAMP/MAMP). I love Rails, but on many occasions have built projects in PHP (using a decent framework like Kohana) just because I was putting this on my client's shared hosting account and didn't want to deal with having t…

One of the interesting things about doing Passenger deployments for Rails is that it's very similar to doing PHP deploys, with the added benefit of the server not reloading any application code until you tell it to. For example: you can update the Rails code on the server, maybe run some data migrations or last-minute production tasks against the new codebase, and THEN tell Passenger to reload the application code. O…

[deleted]

Re: PHP needs to die. What will replace it?

#62

One word: deployment To me, the best thing about PHP is that it is so easy to deploy to pretty much any shared hosting on the planet, not to mention really easy to set up on your local machine (with WAMP/MAMP). I love Rails, but on many occasions have built projects in PHP (using a decent framework like Kohana) just because I was putting this on my client's shared hosting account and didn't want to deal with having t…

One of the interesting things about doing Passenger deployments for Rails is that it's very similar to doing PHP deploys, with the added benefit of the server not reloading any application code until you tell it to. For example: you can update the Rails code on the server, maybe run some data migrations or last-minute production tasks against the new codebase, and THEN tell Passenger to reload the application code. O…

You can do this if you have APC (and you should) installed and running. You can even nuke all the PHP files and APC will still serve the cache until you restart apache/nginx/php-fpm/whatevs.

Re: PHP needs to die. What will replace it?

#64

The article states that php doesn't have lambdas and method chaining, although it does. They aren't well done, as per usual, but it definitely has them. Honestly, we may be best off doing a CoffeeScript style pre-processor for PHP. Because PHP isn't going anywhere, no mattter how much we may prefer other languages, PHP's popularity is one of pure pragmatism, something the language purists don't seem to understand. Ge…

Get me from 0 to "Hello, World" as fast as you can. That's how you build the next PHP.

I understand why that is, but I can't help but think that it's optimizing for an edge case instead of the whole operation. I'm willing to invest a little bit longer to get to "Hello World" on day one if it means a lot less pain for every day to follow.

Re: PHP needs to die. What will replace it?

#65
post #40
post #16

Earlier quoted context omitted.

If installing Rails (or Flask, or whatever) isn't trivial compared to the difficulty of writing the actual code, then either your project is a toy, or your web host needs to get its act together.

I take it you have never tried to get major changes to core server infrastructure approved at large bureaucratic institutions. Writing your code in php is often orders of magnitudes faster, easier and cheaper than getting a decent RoR setup installed.

major changes to core server infrastructure approved at large bureaucratic institutions

It sounds like you've already lost.

Re: PHP needs to die. What will replace it?

#66
Honestly, why does 2 to 4 times slower mean anything? Why can't you cache? or write that really performance intensive part of the app in something else?

There aren't any numbers to back the idea that 2 to 4X performance means something. It's pretty easy to spend $5-10K per month on a single dev, thats a fair bit of hosting.

If the concern is speed of page rendering go with .NET, the JVM, or C++ it's much faster than rails or PHP will ever be. The trick is to use RAD/MVP to get you to that twitter like world of hurt. Then you rewrite in a faster language once you know what your product is like.

Re: PHP needs to die. What will replace it?

#67
post #54
post #17

I'm surprised that you didn't mention HipHop, especially if performance is your biggest gripe. It really is the bee's knees and will only get better. I spent a good chunk of my day looking at PHP code and profiling data. Assocs are terrible for performance but it's not a fatal flaw IMO. What people really want are separate "vector", "dict" and "set" types. It also needs a decent standard library to replace dyslexic c…

Show me a website where php is the source of the performance problems and I will show you a website php allowed to reach success/a large audience. Frankly, unless you are very large scale php is never your bottlenecks, I/O is. And if php become your bottlenecks, you have already won. (of course you could find exemples of math-heavy calculating sites where this isn't true, but that just means you don't know how to pic…

You are right that I/O is usually the first bottleneck. I assure you that being CPU bound is no picnic, not least because most optimization knowledge and experience out there relates to I/O. :)

Even if you are not CPU bound, HipHop is steadily adding grown-up features to the language that make it quite nice to use, functions like mysql_connect_with_db() which save a database round-trip, and extensions like xhprof which will tell you what is actually slow.

Re: PHP needs to die. What will replace it?

#68
post #25
post #3

I won't argue that PHP is getting long in the tooth, has a somewhat unclear future, and some of the standard lib is hella inconsistent, but these points: then what PHP is lacking is lambdas and method chaining. Does the author know anything about PHP at all? As far as I can tell method chaining has been available as long as PHP supported OOP and Anonymous functions have been supported for several years since PHP 5.3…

>>Does the author know anything about PHP at all? The author doesn't know about any other languages either, it seems. I stopped reading when he argued that PHP's assocative arrays was an advantage; hashes/dictionaries are in all the scripting languages. (Afaik, they come from AWK by the way of Perl, anyway -- they were created many years before PHP existed.)

When I read

>> the critical thing Perl was lacking was PHP's wonderfully flexible "associative arrays"

I grabbed my copy of "Learning Perl" from 1997. Chapter 5's topic? Hashes.

Re: PHP needs to die. What will replace it?

#69
post #66

Honestly, why does 2 to 4 times slower mean anything? Why can't you cache? or write that really performance intensive part of the app in something else? There aren't any numbers to back the idea that 2 to 4X performance means something. It's pretty easy to spend $5-10K per month on a single dev, thats a fair bit of hosting. If the concern is speed of page rendering go with .NET, the JVM, or C++ it's much faster than…

This brings up something I feel gets missed in a lot of language/platform discussions: a vast majority of sites on the internet are informational sites for people/companies and plenty of those are created by designers (non-programmers).

When you say it's easy to spend $5-10k per month, you're obviously thinking of a company whose business is the software, but this does not apply to most websites in the world.

Re: PHP needs to die. What will replace it?

#70

I've come to expect hackery from this guys blog. The truth is that for professional, skilled developers, mastering their Nth language is an increasingly smaller investment compared to their first. But for people north of HTML coders and south of professionals, they have a lot invested in the scripting skills they've developed and nobody is interested in seeing the value of their investment diminish for a reason like…

Yeah, the first post I read was the ORM one, which I thought was such an egregious piece of misinformation that I debunked it ad nauseam (http://darwinweb.net/articles/in-defense-of-orms).

Now in this article there's a telling clue to why he thinks writing SQL by hand is better than using any ORM:

> I can knock out a good website in an hour in PHP, and an excellent one in a day or two.

This suggests that he's working primarily on tiny projects. Of course if you are working on tiny projects than an ORM doesn't buy you much. Also, there is perhaps no language suited better to tiny web projects than PHP and I don't see that changing. If you want to make something measurably better than PHP for general purpose web programming you start having to make decisions that developers don't want taken away from them. Rails does what it does by being opinionated, but it works because if the opinions are ill-suited to your project you can still use Sinatra or whatever. If you move too high up the abstraction layer while trying to still serve a wide audience you end up with the kind of morass that is Drupal, where the system can do almost anything adequately, but it doesn't do a great job of anything because of the creaking weight of the infrastructure that attempts to be everything to everyone.

Post reply on HN