Live data from Hacker News

The new PHP

programming.oreilly.com

31–40 of 203 posts

Re: The new PHP

#31

Earlier quoted context omitted.

Make the "stdout == response body" an explicit option Why? It's a primary differentiating factor for PHP, and one of the cornerstones of its popularity. Given that it powers a non-trivial percentage of the web, from single page "hello world" sites up to multi billion dollar ecommerce sites, I'd say 'fixing' that one aspect is not something that needs to be. "== should work like ===". Why? If you want ===, use ===. Bu…

1: "Explicit option" means it's still possible, but shouldn't better practices be encouraged? Anything to push developers away from interleaving logic and templates 2: PHP, however, has types. == is wildly unpredictable

1. Why add complexity when it isn't necessary? Inline output is one of the best features of PHP in that it makes it extremely easy to get started using it. If you want templates you can add them. Not everyone wants them.

2. PHP is dynamically typed, like many other languages, and so you just have to know what types something can be and how they behave together. Even in a statically typed language you need to know how type conversions work. That's what the documentation is for ( http://php.net/manual/en/language.operators.comparison.php ). It's not "wildly unpredictable", it's defined and deterministic.

Re: The new PHP

#32

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.

With previous versions very stable, testable and modern applications could be built as well.

Things like object type hinting can help building stable apps but imho it is still the work of the programmer that can break or make it.

Re: The new PHP

#33
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…

yep. it's amazing when in Python you can end up with "ok", working and maintainable code simply because the languages' severe "handicaps" prevent idiots and "chronic intellectual masturbators" from over-over-over-complecting everything.

I guess Java does the same thing for "enterprise idiots & masturbators" and this is why it's still so successful.

...for some people, making them use a tool that purposely handicaps them is the best thing you can do ...until it turns back to byte you because you now have to use it yourself for a job it doesn't fit, simply because you need library xyz and an easy interface to system abc :)

Re: The new PHP

#34
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…

Umm, like Node?

Re: The new PHP

#35

> 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…

PHP has a rather strict no-BC-break policy for minor releases. As such the 5.x series improves the language mostly through additions. I think that's good. PHP has been missing a number of things that are now present.

However that doesn't work forever, at some point you need to clean up some of the old stuff. That's why a PHP 6 release is planned in the near future (i.e. somewhere in the next three years ^^).

Re: The new PHP

#37
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…

I don't think PHP needs a built-in web server, but for a different reason: there's already tons of others you can use with it.

Re: The new PHP

#38

Earlier quoted context omitted.

I know enough to use === when I program in PHP (even though I oftentimes forget) but newbies don't.

>> but newbies don't ... and sadly constitute a large majority of PHP users.

Isn't that true for all languages though?

Re: The new PHP

#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.

Re: The new PHP

#40
I often wonder why a PHP killer hasn't yet been created.

I don't mean a Ruby or another vastly different language.

I mean a language similar in approach to PHP, but with the gotcha's removed, some order and consistency introduced into the API, and a few changes to the defaults. Open source, free, and on all major OS's.

Post reply on HN