Re: [PHP-DEV] PHP's declining(?) popularity

This is only part of a thread. view whole thread
  107101
September 15, 2019 10:36 php.lists@allenjb.me.uk (AllenJB)
I'm not going to go into my opinions on rankings - others have already 
done enough of that. I concur with them - most rankings are meaningless. 
PHP is also not, in my opinion, dead or dying. It doesn't enjoy the 
monopoly it once had on web-based development, but it's also still very 
popular.

PHP has been my primary language for a long time. I've recently been 
undertaking a small personal project in Python - namely because there's 
no well maintained PHP equivalent of the library I want to use 
(gmusicapi - Google Play Music has no official documented API).

In my opinion, Python is popular on the command-line / linux partly 
because it's become a replacement for Perl. Perl used to be king for 
doing a lot of scripting and anything remotely complex, then they went 
off on their Perl 6 voyage and now I don't think anyone knows what's 
going on with it or has the time to care.

Python also has a reputation for being a language for doing "big data" / 
"machine learning" / "AI" things, and since that's a big thing, it gets 
picked a lot for those reasons.

It's also used in places like Plex and XBMC/Kodi plugins where I think a 
number of people get their first "I want to program" itch. Wordpress 
(plugins) used to be a big draw for PHP here, but I think with the rise 
of alternatives (static site builders, use of other languages, increased 
capabilities on browsers) this has waned over the years.

Maybe it's coming from PHP and I was specifically trying to avoid having 
to deal with writing / using a Python HTTP server and getting a setup 
similar to PHP-FPM, but in my opinion setting up anything web-based in 
Python is kind of a mess - there's a lot of alternatives and no clear 
easy option. For me, PHP, with the simplicity of PHP-FPM is, in my 
opinion, clearly better here.

One area where I think Python really stands out compared to PHP tho is 
its "new user experience". Starting with the official tutorial ( 
https://docs.python.org/3/tutorial/ ): While I was obviously coming in 
with a lot of programming knowledge, I felt Python's tutorial is very 
well done. Its well laid out index means you can quickly skip around 
when you already know what you want to achieve (but not how to achieve it).

Compare this to the official PHP tutorial ( https://www.php.net/tutorial 
) which to me feels pretty much only covers a basic HTML form. The 
"What's Next" section directs you to http://talks.php.net/ which has 
very limited content from the past 5 years and a lot from before that. 
It also has a theme that hurts my eyes to look at (kind of ironic that 
the "PHP Presentations" site has horrible presentation =P ). The "What 
Can PHP Do" link takes you to a page that is pretty much a wall of text. 
It spends a lot of time talking about things (eg. listing supported 
operating systems) that probably 99% of users don't care about at this 
point as well as linking to effectively dead projects like PHP-GTK.

If you then try to proceed onwards, one of the next things people 
frequently want to do is storing information in Sessions ( 
https://www.php.net/manual/en/book.session.php ) (from my experience 
helping users in the likes of Freenode's ##php ). While I understand 
this section as a long time PHP developer and it does cover a lot of 
technical information, if you're coming into this as a newbie developer 
while you can sort of get some basic session code going on, many newer 
developers do hit / have questions on slightly more complex topics like 
session locks or session file management and are, I believe, quickly 
left with their head spinning.

Python also has a user editable wiki with the Beginners Guide ( 
https://wiki.python.org/moin/BeginnersGuide ) being practically the 
first link after the main documentation links on the Docs section of the 
Python site ( https://www.python.org/doc/ )

I think the entire "new user experience" of PHP could do with review. 
Some suggestions to start:

* Link directly to the tutorial from the front page of php.net
* Look at removing the https://www.php.net/docs.php page and replacing 
it by linking directly to the manual.
   * PHP 4 documentation, "More documentation" and downloads could be 
linked as an / from an appendix.
   * There's already a language switch on the top right of the page for 
swithcing to other languages
* Move contributors to an appendix - it unnecessarily takes up a 
significant amount of space at the top of the manual index forcing users 
to scroll down to the content they want. We're all very grateful to the 
manual contributors, but it's not what 99% of users are there for.
* Link directly to Language Reference ( 
https://www.php.net/manual/en/langref.php ) and Features ( 
https://www.php.net/manual/en/features.php ) from the tutorial

talks.php.net:
* Update links to use HTTPS (minor, but the "Not secure" is still ugly)
* Link from the front page of php.net
* Make it clear and easy for users to submit new talks and otherwise 
contribute to this section
* Improved theme that doesn't make me want to scratch my eyes out. Avoid 
unnecessary animations (the elephpant is cute but it keeps pulling my 
brain from the actual content). (I might look into submitting some 
simple changes if/when I can find the repo for this)
* Review and tidy up older talks
   * Remove anything that's completely out-of-date / doesn't work in PHP 7.x
   * Where multiple talks cover the same topic / material, pick the best 
/ more up todate ones (for example there's like 3 dozen XDebug talks)
   * Some talks are broken - for example 
http://talks.php.net/show/vxml_php_2004 gives an error when trying to go 
to the next slide (bug filed: https://bugs.php.net/bug.php?id=78542 )

* Consider a user-editable wiki
   * Talks would go well here, I think
   * See examples where other OSS projects do this - Python, Arch & 
Gentoo Linux

A wiki might not be necessary if/when users can submit changes to the 
above mentioned content via GitHub assuming it's in an easy-to-edit 
format, which I know is being worked on. I understand the challenges of 
moderating wiki's (I was an moderator on the unofficial Gentoo Wiki for 
a time) and a PR based system does have the advantage of completely 
preventing spam / bad faith edits making it to the live documentation/site.

A wiki would however provide a place where unofficial links can be made 
- for example I feel it kind of weird that Composer / Packagist gets no 
mention on php.net. I understand it's a separate project and php.net 
doesn't want to prevent or dissuade competition, but it is also the 
defacto package manager for PHP and an easy way to find libraries for 
getting things done.

With regards to academia, we were taught PHP in the web module on my 
Computer Science course at uni (England), but as can be the case the 
material was out of date and hadn't been revised in a few years. I have 
no idea how to solve this problem because it stems from teachers who 
don't care about the subject.

AllenJB