Hacker News new | ask | show | jobs
by michaelchisari 5369 days ago
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.

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

4 comments

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

Well put.

I can't think of any other languages that let you do `echo 'Hello World' > /Library/WebServer/Documents/index.php` and you already see that in the browser because it comes with your OS. It's hard to beat that for normal folks just starting out making web pages.
ASP?
semi-colon
Exactly. To beat PHP, you have to be as easy to write as static HTML. Even though I have done Ruby, Node.js and ASP.NET projects, I still go back to PHP because of how easy it is to go from 0 to hero without all the fuss.

The closest thing I've found is the serve gem, which lets me launch a web server from my current working directory. It lets me quickly mock something up in ERB, Haml and SASS without messing with Rails or Sinatra. As a complete newbie, with no coding experience, PHP is a much easier hill to climb than Rails or Django, which is Mt Everest by comparison.

I agree with you and I think it goes even further than that: get me from hello world to mockup of my final app to my final app. Coding in php isn't pretty, but it's fast, even once you get past that hello world part.

Look at all the questions on stackoverflow from total beginners: they don't understand much of what they are doing yet, but they already have working forms and several pages and, well, results.

Of course, that's also part of what makes people hate php.

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.

A useful criticism, but in this case I don't think it's optimizing for an edge case. There's a power law, or something close to it, when it comes to web developer skill. PHP is so dominant because it requires very little skill to get started, and very little skill to incrementally advance from there.

Other technologies can try to push on the "PHP problem" from above, and they can make a lot of progress, but they won't ever "win" because the inertia of PHP is coming from below. The only way to fully get rid of PHP is to beat it on its home turf, and that's firmly in the "Hello World" realm.

I guess it depends on what the goal is. I personally don't care if anything kills or supplants php. Different people can and should use different tools.

When trying to answer the question of "what tools should I, as a serious professional who is in this for the long-term, choose to work with right now?" it's really short-sighted to balance everything on how easy it is to get to "Hello World".

Most of the people using PHP almost certainly disagree with you. (Most of the people who have a clue about PHP, i.e. @fabpot and crew, may not disagree so strenuously, but I would suggest that they are the edge case.)
Of course the people who don't find php to be painful would disagree in my assessment that php is painful, kind of by definition. :)

Would you choose an operating system based on how easy it was to install, or how pleasant it was to use?

Sure, but you said that that was "optimizing for the edge case". Your edge case is PHP's base case, y'know?