Live data from Hacker News

The new PHP

programming.oreilly.com

111–120 of 203 posts

Re: The new PHP

#111
post #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 ^^).

The very first programming book I bought was "PHP6 and MySQL5" by Larry Ullman. I bought that one specifically because I had another job (career, really) and I knew it was going to take a while before I really got into programming and I didn't want to buy a book that was going to be out of date in 2 years. That book is now 6 years old, out of date, and PHP6 is still not released. Maybe 6 is just an unlucky number with Perl unable to make that goal as well, but either way I'm not holding my breath.

I've since moved on to more well thought out languages, though PHP keeps pulling me back in. I'm currently having to support a CI app that hasn't had a line of code added to it since 2008, and the only thing I can say, even though I appreciate the language and how far it's pushed the web, I'm glad it's no longer my go-to language of choice. Keep PHP5 around for a while so apps like this one can continue on, but PHP6 is _LONG_ overdue.

Re: The new PHP

#112

Whenever I hear "the new PHP" or "its not the old mess anymore", I say to myself, thats hardly the point. The key flaw I find with PHP is with its community and lack of any mature frameworks. Half of the PHP coders are hopeless script kiddies, thanks to low barrier entry it has, and I don't feel a single framework exists that can match Rails or Django. For the matter of fact, the framework with largest community, Cod…

Frameworks are not as important as they once were with the widespread use of composer and componentized architecture

Re: The new PHP

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

What? How often does that actually happen?

I don't think I've ever heard of new PHP devs "launching with the built in web server". Django has shipped with a built-in insecure web server for years and no ones crying to fix it.

There's things to fix in PHP, but this is not one.

Re: The new PHP

#114

Whenever I hear "the new PHP" or "its not the old mess anymore", I say to myself, thats hardly the point. The key flaw I find with PHP is with its community and lack of any mature frameworks. Half of the PHP coders are hopeless script kiddies, thanks to low barrier entry it has, and I don't feel a single framework exists that can match Rails or Django. For the matter of fact, the framework with largest community, Cod…

I find it hard to believe you're a PHP developer and believe Codeigniter has the largest community. Perhaps you primarily used PHP 3-5 years ago. If you haven't been following Laravel 4 development, you're entirely missing out on a community that's bringing the love back to PHP. The core PHP community is extremely knowledgable; you're just not interacting with the proper subset. If you take a look at the conference c…

Can second this. Laravel is one of the nicest PHP frameworks out there. The whole thing is squeaky-clean and well-designed.

Re: The new PHP

#115

Earlier quoted context omitted.

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…

" Not everyone wants them." And not every project needs them. PHP has been wildly successful precisely because it can fit in entirely small use cases, as well as big cases. Someone who needs to create a dynamic footer with a "copyright $year" in it... has no need for MVC, routing, templates, version control, etc. They just don't. It's precisely because PHP has a default content-type output of 'text/html' that this so…

>And yet... this is where the majority of the next generation of developers (and the current gen, and the one before) come from.

To say nothing of the innumerable medium sized businesses that use these kind of "throw away" techniques to generate vast revenue. Companies that were profitable long before node or mongo entered the collective vernacular and will likely continue to be profitable long after they've faded from popularity.

Re: The new PHP

#116
I used to write PHP before I got into Ruby. I'm glad PHP is getting it's shit together, but it's still a no-language for me.

Re: The new PHP

#117
post #26

While the gist behind this post is right, the article contains a number of factual errors. E.g. the version numbers in the "language features" section are pretty messed up: * Namespaces, closures and FPM were already in PHP 5.3 * The built-in web server was already in PHP 5.4 * Improved variadic functions, argument unpacking and phpdbg will be in PHP 5.6, which goes to beta in about a week.

Hi nikic. Thanks for the feedback! (I'm the author of that article). The O'Reilly editors made a few changes to the wording without my review that make it more ambiguous as to what features were introduced in what version. I agree as is it can be confusing. But the point is that the latest version of PHP provides all of these features. The variadic function statement was an error on my part and it has since been corrected in the article.

Re: The new PHP

#118

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

I realize the PHP API is a mess compared to highly curated and standardized offerings like Java, but growing up with it, it was very like C standard lib and other things of the time. I could often even guess functions without looking them up even though they had weird names and abbreviations.

Re: The new PHP

#119
post #87

Earlier quoted context omitted.

20 words of that manual were dedicated to letting people know its not for use in production. Un-highlighted and buried at the end of a paragraph that I initially skimmed over and didn't even read. No attention is directed at it in any way. So the server outputs a message. Great. Is it huge, red and says "do not use me in production"? No. Its a standard version banner.

There's no pleasing you, is there? Maybe we should add some and ?

Really? Look at the documentation page. The first thing you see is a huge chunk of text with absolutely no highlighting to guide you. Most people would just skim their eyes over that, and my attention gets drawn to the list of MIME types because it looks different.

Compare these two screenshots: http://i.imgur.com/Kzdphar.png http://i.imgur.com/CQnU8aG.png

A simple bold tag immediately draws focus and ensures that the huge majority of people who view the page get the important message. That's not being hard to please, it's just common sense.

Re: The new PHP

#120
Here's what would make me accept PHP as passable practical web programming language: A good REPL, with good support for it over all frameworks. That's all it would take.

Given that it doesn't have one, python beats it easily.

Post reply on HN