Live data from Hacker News

The new PHP

programming.oreilly.com

71–80 of 203 posts

Re: The new PHP

#71
post #16
post #5

Earlier quoted context omitted.

The web server is explicitly for development purposes. It is not meant for production. > It strikes me that adding more tools that incompetent web developers can abuse is what got them there in the first place. This is profoundly ridiculous. It's the equivalent of saying Home Depot shouldn't sell power tools because some do-it-yourselfer might saw his foot off. Just because a tool can be misused is not an argument ag…

Just because a tool can be misused is not an argument against it nor its inclusion. I used to believe this, but now I couldn't disagree more. People can and do misuse things all the bloody time, and the more you enable them to do that, the worse your tool is. How people use what you make is every bit as important, possibly even more important than the technical merits of what you make. I'd rather a builder use a seco…

> People can and do misuse things all the bloody time, and the more you enable them to do that, the worse your tool is.

By that measure, PostgreSQL is a horrible database. After all look what happens when I do this:

    CREATE TABLE foo (
       id serial not null unique,
       bar text primary key
    );

    CREATE TABLE foobar (
       chunk_id serial not null unique,
       foos foo[]
    );

    INSERT INTO foobar (foos) values (array[row(1, null)::foo, row(2, '1323')::foo, row(3, '2222')::foo]);

    select * from foobar;
I mean my gods. Such horrible misuse of a relational db!

Re: The new PHP

#74
post #2

> It contains powerful new features and helpful developer tools, such as a built-in web server I haven't finished the article yet, but really? Is that what PHP needs? A built-in web server? It strikes me that adding more tools that incompetent web developers can abuse is what got them there in the first place. How long until we start having security releases for the PHP web server, because so many clueless devs decid…

Considering the fact that I can set up a development environment in docker using PHP with a makefile and it's built in webserver, I'd say you've missed the point of it. It's a great addition, and with Composer/Packagist (which does currently have an issue with replacement packages, that needs to be fixed) plus the new features in 5.5, I can comfortably say I like using PHP.

Also, I've really got to stop reading the comments on PHP threads here on HN. They're repetitive, pointless and negative to the point of blindness. I'll go back to building cool things in it (and Go and Ruby and lately C, because while each of those have their issues they all serve a purpose and do it well).

Re: The new PHP

#75
post #39

I don't get it. Why people can't just admit the fact that PHP had his time and now, no one with common sense would not start new project (except simple wordpress stuff) in PHP.

In most enterprise environments, you have your choice between .NET and PHP. Given the option, I'll take PHP, thanks.

Re: The new PHP

#76
post #60

Earlier quoted context omitted.

I don't hear people complaining about Python's builtin webserver. Maybe thats because Python only attracts people who do things correctly right?

Python doesn't have a builtin webserver, but there is one in standard library of CPython. I've yet to see an article that would argue that its existence is a proof that you should be using Python now.

Then you missed the point of the article, and also obviously don't use PHP regularly. It's a super handy feature.

Re: The new PHP

#77
post #23

I'm a Drupal dev by trade, and I consider any day that I don't have to get into the guts of Drupal and write PHP a good day. Recently, however, I had to get in there. This was a few days after I upgraded my local environment from 5.3 to 5.5. I've been writing Ruby for fun for a while now, and I love how I almost never have to look API related questions up, at least in comparison to PHP API questions. So I just wrote…

I did the same job for 6 months. I really like PHP nowadays, but Christ Drupal core is a mess (or was, that was v6).

Re: The new PHP

#78
post #53

All this is very true. Modern PHP is not the PHP of yesteryear. With Composer for dependancy management and sticking to the PSR's you can build very stable, testable, and modern applications that change minds about PHP.

The thing is you have to be a medium-to-expert to be confident about Composer dependencies, every new dev is going to use the language API, which resembles a bunch of functions with no general pattern. PHP users need to keep it together and set a common base, a standard library with sane defaults.

Some of the biggest names in PHP are working on that exact idea!

Re: The new PHP

#79
post #51
post #41

Earlier quoted context omitted.

check what PyPy did (or is doing with PHP).

Could you please explain it a bit or provide a link?

HipHop its Facebook sponsored just in time compiler for php. HHVM (Hip Hop Virtual Machine). My understanding is its 95%ish compatible with most php. They're working using framework unit tests to get the percent higher. http://www.hhvm.com/frameworks/

https://github.com/facebook/hhvm

Re: The new PHP

#80
post #67

> generators for simpler iteration, namespaces, and variadic functions and argument unpacking. With PHP 5.4, traits were introduced (a la Scala or Perl) to allow code reuse in single inheritance languages, as well as closures, which allow you to code PHP in a functional style. "The new Java" It's good to see PHP maturing. However sometimes the most important features of a language are the features you don't add. I th…

There's some discussion on the RFCs and mailing lists about creating new backwards-incompatible OO APIs for the core libraries which would eventually replace some of the legacy mess.

I think this is the way to go about it. And if earlier versions want those kinds of APIs they can implement them in packages.
Post reply on HN