Live data from Hacker News

PHP 7 Released

github.com

81–90 of 317 posts

Re: PHP 7 Released

#83
post #67

Earlier quoted context omitted.

This is an arrogant and immature type of thing to write. This is programming, not high school cool-kids club. PHP is a wonderful tool that was mostly responsible for the dynamic web. Before it became popular, the web was mostly static HTML with an occasional CGI form, probably written in something like Perl, mostly just for emailing the webmaster. Maybe some small amount of JavaScript for something like rollover effe…

I agree with rejecting the elitist framing but … the web was decidedly not mostly static before PHP came along. Perl had many frameworks (e.g. PHP started as one), as did conventional languages like Java, Python, with deep server integration possible using things like mod_perl. There were also a bunch of web-specific dynamic platforms like Cold Fusion and classic ASP / me-too JSP. Finally, there was server-side JavaS…

If you were a corporate/academic programmer at the time, or lucky enthusiast, you had access to more things. Most commoner folk stepping up to a local ISP shell from BBS did not have access to all kinds of goodies. There also was less formal education available, so even when technologies existed, without mainstream marketing and documentation, it simply wasn't accessible to the masses. Cold Fusion was proprietary software from Macromedia you had to pay for, as I recall. Some admins were restrictive, and didn't even like you compiling your own stuff.

PHP really was responsible for the dynamic web. It had enough community support to enable newbies to wrap their head around the mind-boggling shift to dynamic server-side websites, and it became commonly provided with cheap or free shared hosting.

A big reason why it succeeded was because it was possible for people who only understood HTML to transition, since a PHP file could be nothing but HTML to start with, and people used a lot of templating rather than start from scratch with code that echoed out HTML. With things like Perl, it was not an HTML templating script first, and so that made it less streamlined and simple for the task of making websites.

Re: PHP 7 Released

#84
post #69
post #58

Earlier quoted context omitted.

To me, it's a so-so language, with some bad parts, some ok. On the plus side, it's easy to pick up, and it gets the job done for many projects. Perhaps it's a bit like the Ikea of programming languages, if you will--no the best of furniture for sure, but when you need a table and some chairs with little efforts, it's nice to have, and they're not horrendous unless you couldn't build them correctly.

I like the IKEA parallel as IKEA is cheap. So was php (to host), hence the popularity I guess. And as a result of that, there are lots of developers.. and many equals cheap. And the vicious circle continues. Doesn't make it a good language :) (To be honest, I like IKEA, and I don't think it suck)

> To be honest, I like IKEA, and I don't think it suck

Ikea sucks. Quite a bit of the furniture is just painted cardboard, the quality is absolutely horrible. It looks ok but 'under the hood' it is terrible. It is throwaway furniture, the very opposite of sustainable.

Re: PHP 7 Released

#85

Earlier quoted context omitted.

And every php developer would wish that suddenly all php in the world upgrades to v7. We are years away from 7 having a big penetration in the ecosystem. And years more till it hits enterprise.

The performance improvements along with the support policy should hopefully encourage many sites to move to PHP 7 within a year; PHP 5.6 will be unsupported in 8 months (though it will receive security fixes for another year).

Unfortunately several of the most popular PHP based platforms will be stuck using PHP 5.9 or older for some time. Magento just recently in version 1.9 added support for PHP 5.6. There are still an allarming number of Drupal 6 based sites out there in large scale production that have trouble supporting PHP > 5.4

The recent releases of Magento 2.0 and Drupal 8.0 should help move more sites to modern versions of PHP, but there is a lot of work still to be done on contrib modules to get full functionality out of M2 and D8

Re: PHP 7 Released

#86

Earlier quoted context omitted.

I am an experienced programmer but I've only touched PHP a few times, years ago. What are the best books or tutorials to get an overview of modern PHP?

I think the question is why should you bother with PHP at all? It had its time in the history of the web but that time has passed, long, long ago.

What would you use instead and why?

Re: PHP 7 Released

#87

I wish every PHP developer would reread the docs and start using new features available instead of just continuing with what they know already just because it works. And of course if there was any way to remove all those old tutorials out there.

And every php developer would wish that suddenly all php in the world upgrades to v7. We are years away from 7 having a big penetration in the ecosystem. And years more till it hits enterprise.

I'd disagree with this. Performance increases get attention from system admins. It will take time yes, but if it saves them money, they will likely investigate sooner.

Re: PHP 7 Released

#88

Earlier quoted context omitted.

I am an experienced programmer but I've only touched PHP a few times, years ago. What are the best books or tutorials to get an overview of modern PHP?

I think the question is why should you bother with PHP at all? It had its time in the history of the web but that time has passed, long, long ago.

Wordpress alone runs 25%+ of all websites. PHP's time is clearly still now.

I probably won't bother with PHP, but it can't hurt to keep my idea of what it's like up to date.

It's only technology, no need to be fanatical about it.

Re: PHP 7 Released

#89
post #79

Earlier quoted context omitted.

I am an experienced programmer but I've only touched PHP a few times, years ago. What are the best books or tutorials to get an overview of modern PHP?

I found http://www.phptherightway.com/ to be very useful. Here is also a review of it to get another impression of this freely available book: http://alanstorm.com/php-the-right-way-review

Thank you!

Re: PHP 7 Released

#90

Earlier quoted context omitted.

> It doesn't have to be one or the other. Sure there's a spectrum. But even with one level I'm still guessing whether it was String.toInteger or Integer.toString, or String.parseInt or Integer.parseInt or Number.parseInt or whatever ... and since I need to check I don't mind finding out it's a global function named str2int or even int() that takes whatever.

If you have to look it up anyway, what difference does it make if it's a global or namespaces? If you don't know, you don't know. As such, your point as stated doesn't counteract why polluting global namespaces is a bad thing. There are arguments that could be made (PHP VM specific), but "I didn't ever RTFM and/or retain it" doesn't fly to me personally.

> what difference does it make if it's a global or namespaces?

I feel that it's often easier to remember short unique name like str2int than long, deceivingly reasonable name like: System.Web.Script.Serialization.JavaScriptSerializer.Serialize

I agree though that array_uniq is same as Array::uniq

> why polluting global namespaces is a bad thing.

Why is that bad for language wide utility functions?

I though global is bad mostly in your own custom code or you application specific libraries because it's accessible from everywhere which hides the dependencies (no to mention global mutable state which makes "action at distance" prevalent).

Post reply on HN