Live data from Hacker News

PHP Apprentice – An online, open-source book for learning PHP

phpapprentice.com

41–50 of 75 posts

Re: PHP Apprentice – An online, open-source book for learning PHP

#42
post #21

I haven't used PHP in around 6 years (running PHP 4 I belive); has the language improved ? My biggest complaint was that the API was incredibly inconsistent, but that seemed like it could be improved in later versions if they weren't afraid of breaking backwards compatibility.

One of the best things of PHP today is the ecosystem. The PSR [0] interfaces let you build your own framework using libraries from the major frameworks or independent libraries seamlessly.

[0] https://www.php-fig.org/psr/

Re: PHP Apprentice – An online, open-source book for learning PHP

#43
post #21

I haven't used PHP in around 6 years (running PHP 4 I belive); has the language improved ? My biggest complaint was that the API was incredibly inconsistent, but that seemed like it could be improved in later versions if they weren't afraid of breaking backwards compatibility.

PHP 7+ is a totally different world from 4. It’s actually a real programming language now. The massive API redundancy is still there, but you have classes, namespacing, etc.

Re: PHP Apprentice – An online, open-source book for learning PHP

#44
post #21

I haven't used PHP in around 6 years (running PHP 4 I belive); has the language improved ? My biggest complaint was that the API was incredibly inconsistent, but that seemed like it could be improved in later versions if they weren't afraid of breaking backwards compatibility.

you would barely recognize it it's more like Java now that PHP4, just look at what is going on with Laravel ... having moved to a job that uses python and go, I still miss and am in awe that Laravel is the absolute best framework I have encountered in any programming language. There is nothing close to it any of the other languages.

Re: PHP Apprentice – An online, open-source book for learning PHP

#45
post #21

I haven't used PHP in around 6 years (running PHP 4 I belive); has the language improved ? My biggest complaint was that the API was incredibly inconsistent, but that seemed like it could be improved in later versions if they weren't afraid of breaking backwards compatibility.

Yes, including today's merge of property types:

    class A {
        public int $id = 0;
        public ?Foo $somefoo;
    }
The language has evolved slowly but surely, and it's now much harder to make obvious mistakes thanks to a bunch of good-quality static analysis tools (one of which I authored).

Re: PHP Apprentice – An online, open-source book for learning PHP

#46
post #36

Earlier quoted context omitted.

Everything is political. I wouldn't want people to downvote Mercurial links into oblivion. Anyway, Google links are pretty much already ordered by popularity.

That's the problem, in technical links popularity (as in number of visits) is not linked to correctness, that's one of the reasons StackOverflow is so useful, because the top-voted answer is like 99% of the times the most correct (useful) one.

Except when that answer is 5 years old and is as wrong as the ExpertsExchange post from 2001.

Re: PHP Apprentice – An online, open-source book for learning PHP

#47
post #21

I haven't used PHP in around 6 years (running PHP 4 I belive); has the language improved ? My biggest complaint was that the API was incredibly inconsistent, but that seemed like it could be improved in later versions if they weren't afraid of breaking backwards compatibility.

PHP 7+ is a totally different world from 4. It’s actually a real programming language now. The massive API redundancy is still there, but you have classes, namespacing, etc.

Also adding libsodium directly into PHP core as of 7.2 was a big step in the right direction IMO.

Re: PHP Apprentice – An online, open-source book for learning PHP

#48
post #46

Earlier quoted context omitted.

That's the problem, in technical links popularity (as in number of visits) is not linked to correctness, that's one of the reasons StackOverflow is so useful, because the top-voted answer is like 99% of the times the most correct (useful) one.

Except when that answer is 5 years old and is as wrong as the ExpertsExchange post from 2001.

Unlike EE, though, any user can propose an edit to that now-incorrect answer (or just edit it outright, if they have 2k rep).

A nice big "this answer is outdated, see [other answer]" note does wonders.

Re: PHP Apprentice – An online, open-source book for learning PHP

#49
post #46

Earlier quoted context omitted.

Except when that answer is 5 years old and is as wrong as the ExpertsExchange post from 2001.

Unlike EE, though, any user can propose an edit to that now-incorrect answer (or just edit it outright, if they have 2k rep). A nice big "this answer is outdated, see [other answer]" note does wonders.

Unfortunately, such edits are rarely accepted. The intent was for the site to be more wiki-like, but these days "respect the author's intent" is the prevailing wisdom. The cases where someone edits a top answer with a significant correction or update are very few, and require overwhelming community support or they'll be reverted.

This is particularly distressing in the case of security vulnerabilities. Vulnerable code being copied from Stack Overflow into consumer applications isn't hypothetical, it's been empirically demonstrated (https://www.aisec.fraunhofer.de/en/stackoverflow.html), yet the community and company refuse to accept responsibility and address the problem. (Of course the developer creating the application is more responsible, but Stack Overflow is in a position where they could help protect innocent end users and the common good.)

Pinning of accepted answers to the top of the list was a good idea when the site was young. These days, it prevents updated better answers from taking the place of ten-year-old misinformation.

Re: PHP Apprentice – An online, open-source book for learning PHP

#50

I love PHP, it was my first “real” programming language, and I’m glad there are still people trying to make it easier to adopt. Having skimmed through several of these chapters, though, I just feel like it’s too similar to the official PHP docs, even down to the TOC. Wouldn’t it have been better for everyone to put this effort into improving the docs, rather than developing yet another book in a silo that likely won’…

Imagine this kind of reception for any other content. Someone spends a year into composing a new symphony and the reviews go "I love live music but wouldn't it have been better if the composer would have re-orchestrated a familiar classic rather than developing a whole new score that won't be performed as often as we'd like?"
Post reply on HN