r/AskComputerScience • • Mar 07 '19

Do people still use php?

So the other day my friend told me how I shouldn’t learn php and learn Javascript instead as nobody uses php nowadays. To what extent is this true?

34 Upvotes

38 comments sorted by

19

u/WanderingKazuma Mar 07 '19

Pretty sure Facebook is using a customized version of PHP behind the scenes. Laravel is huge these days as well.

2

u/PM_ME_YOUR_REPO Mar 07 '19

Facebook is made with Hacklang, a language that started as a superset of PHP with a modified runtime and has diverged substantially since then.

1

u/ryanmerket Jul 18 '23

I checked code into Facebook's codebase before. There's a lot of PHP in there.

1

u/PM_ME_YOUR_REPO Jul 19 '23

4 years ago

1

u/ryanmerket Jul 19 '23

Never a better time than now.

22

u/g105b Mar 07 '19

PHP is everywhere.

In terms of market share, it wins by a grand majority. Why is that the case? Probably because of how easy PHP was to get started (and still is). Low barrier to entry = more users.

However, only a few years ago, PHP lacked a lot of features that you would expect in a modern programming language, and that means there is a lot of bad code out there, and even more bad advice. A lot of people like your friend still think that's what PHP is now.

Nowadays, PHP is a language that has got good pace in terms of modern features and speed, but most importantly it has a great project governance model unlike other popular web languages.

7

u/IAmNotNathaniel Mar 07 '19

This, 100%. Been doing php for well over a decade. We took pains to develop using as much object-oriented design as possible, but recently more and more has been baked in to make things faster and less prone to sloppiness.

It's far better than it was 20 years ago.

2

u/stevenjd Mar 09 '19

In terms of market share, it wins by a grand majority.

You are surely joking.

According to TIOBE's figures for March 2019, PHP comes in at #8 (down from #7 this time last year) with 2.42% popularity, six times less popular than Java.

PYPL puts PHP at #5 with 7.34% popularity.

Github is reported to have placed PHP at #3 (no percentage given), but it also found shell script programming was the 8th most popular language choice, and C the 9th most popular, so I question the reliability of its data.

Redmonk puts PHP at #4.

There's no doubt that PHP is a popular language; depending on how you measure popularity it will appear in the top 10, or even the top 5, most popular languages. But to suggest that it "it wins by a grand majority" is ludicrous.

1

u/g105b Mar 09 '19

I should have been more specific. By market share I meant number of websites by programming language. That was ignoring the huge bias of the number of Alexa top 100 websites running PHP.

2

u/sicilian_najdorf Jul 31 '19

PHP is still number 1 at usage of server side programming language. It still holds 79.1%

https://w3techs.com/technologies/overview/programming_language/all

Php is also getting better and better.

26

u/mrasadnoman Mar 07 '19

Yes. A significant majority still does.

Yes javascript did took the world like a ............

But php has its own way of doing things and is still preferable.

11

u/Wohlf Mar 07 '19 edited Mar 07 '19

Plus it's not an either or, I certainly wouldn't prioritize PHP over JavaScript but you can easily get a working knowledge of both. I found PHP to be super easy already having done some web development with Python and Node.

2

u/stevenjd Mar 09 '19

A significant majority still does.

Only if 7.34% counts as a majority.

1

u/mrasadnoman Mar 09 '19

"7.34% of 21 million" does.

1

u/stevenjd Mar 09 '19

You fail maths. 51% is a majority. 49% is a minority. 7.34% is a small minority, not a majority.

1

u/mrasadnoman Mar 09 '19

You are missing ".. As compared to..".

0

u/sicilian_najdorf Jul 31 '19

PHP is still number 1 at usage of server side programming language. It still holds 79.1%

https://w3techs.com/technologies/overview/programming_language/all

Php is also getting better and better.

9

u/Felicia_Svilling Mar 07 '19

People still uses COBOL. That said you are certainly better of learning Javascript if you have to choose. It's not like it would be hard to learn php if you would ever need it.

9

u/combuchan Mar 07 '19

PHP is everywhere in things like wordpress and drupal and lots of older web apps (facebook still uses a variant called hack and iirc upstreams a lot of code). It dominates smaller, non-tech markets for things like small business client web design.

So it's obviously not that nobody uses it, it's just passé. Some startup to use it would probably be out of their mind. I don't follow the language much anymore but it took a long time for it to not suck and it probably still does in ways. Python, node, and to a lesser extent things like rails and scala have taken over php's leading edge role on the web for which it was designed.

I don't know what you already know but I would not do JS for a first language. You are better served understanding the basics in something like Python and understanding how js is different after.

6

u/HasFiveVowels Mar 07 '19

I agree but I'd like to add that, even for all the hate it gets on reddit, javascript is a great language to have in your tool belt. More and more, software is being written for the web in lieu of desktop applications and having a strong understanding of javascript can be very valuable. Reddit craps all over Electron and React Native but there's a reason companies like Slack and Spotify use it - a single code base can facilitate their website, desktop app, and mobile apps. The result isn't the utmost in terms of performance but, as a business decision, it's hard to beat.

3

u/combuchan Mar 07 '19

I didn’t say I was a bad language to learn, I said I was a bad language to learn as a first language.

3

u/HasFiveVowels Mar 07 '19

Yea, like I said, I agree. I just wanted to give them a heads up about its actual usefulness. If they're on reddit and in programming subreddits, it's impossible that they haven't heard "javascript sucks". But, like you say, it's not a great language to learn fundamentals in.

-1

u/sicilian_najdorf Jul 31 '19

Laravel or Symphony are a better alternative than wordpress. Laravel and Symphony are like java spring. These are well designed modern php frameworks. There are many projects where using PHP is a good choice. Swoole php blows out node js at asynchronous speed. PHP 7 is 3 times more faster than Pyhthon.

6

u/pilibitti Mar 07 '19 edited Mar 07 '19

PHP is everywhere, but 90%+ of it from insanely popular projects and services that got their market share many years ago from a time where there were no alternatives. So while you'll find sites running PHP all the time, you'll be hard pressed to find NEW projects starting out with PHP.

For instance Wordpress is PHP. Some estimate that 30% of the world's websites run on Wordpress. But if you'd start a CMS framework today, you probably wouldn't start with PHP due to various reasons. When these older projects started, you had close to no alternative.

1

u/sicilian_najdorf Jul 31 '19

Laravel or Symphony are a better alternative than wordpress. Laravel and Symphony are like java spring. These are well designed modern php frameworks. There are many projects where using PHP is a good choice. Swoole php blows out node js at asynchronous speed. PHP 7 is 3 times more faster than Pyhthon.

1

u/pilibitti Aug 01 '19

The whole stack is going out of "fashion". It is a reality of the software ecosystem. Even node is past its peak and will meet PHP's demise. Things change. I understand that there are new and exciting additions to the ecosystem but that doesn't change the unstoppable forces of nature. Pretty soon (in a decade or so) PHP will mostly be for "legacy projects". Add another 5-6 years and node will be there. That doesn't mean they are not useful. Erlang is as legacy as it gets but it still gets the job done today. It is powerful, and right for many projects. There even would be specialist software that would start out with Erlang today. But the point is it is specialist software, an exception. Do people still use Erlang? If you answer the spirit of the question, no, they don't. But that is "factually" false, there are a few that use it. And there is enormous amount of legacy software that is still maintained (and you and I interact with every day) - doesn't change my point.

2

u/Lofter1 Mar 07 '19

yes, it's still the most used language in back-end, but it slowly loses importance. multiple reasons for it. but it will lose more and more importance and relevance (when it doesn't get a serious overhaul in the next few years), cause there are far better options out there nowadays.

it won't be like it's irrelevant in the next 5 years, too much stuff does rely on php, but people will move on to more modern, better designed stuff, and in the next....lets say 10-15 years (again, if php doesn't get a serious overhaul, that might actually safe php's grandpa-butt), this technology will have lost against it's competitors completely.

0

u/sicilian_najdorf Jul 31 '19

PHP is still number 1 at usage of server side programming language. It still holds 79.1%

https://w3techs.com/technologies/overview/programming_language/all

Define modern and better designed stuff? You can designed well with php 7. Php 7 is modern and has modern frameworks like laravel and symphony. PHP has dependency manager, dependency injection, asyncronoues capabilities, multi threading, cli etc. So define modern and better designed stuff? PHP swoole blows out node has at asynchronous speed. PHP 7 is 3 times more faster than python. These frame works are like Java spring. Php is also getting better and better. php 7.4 will be released this year.

2

u/404errorlifenotfound Mar 07 '19

I’m currently competing in a high school web app contest that uses a framework that has php. I have no background knowledge on php so I’m figuring it out as I go

2

u/ryan_the_leach Mar 07 '19

There's a ton of money in PHP, due to so so many shitty sites needing maintenance.

That said, as an industry, no one really wants to start new projects in it unless they are already invested.

That said, one of those people that are still invested is Facebook...

Not to mention Wordpress, Drupal, and several other CMS systems.

So it's going to take a long ass time dying.

1

u/sicilian_najdorf Jul 31 '19

PHP still holds 89% of the web as of today. There are big industries that uses PHP for their new project. PHP is not only about Drupal,Worldpress etc. Laravel and Symphony are hot commodities right now. PHP is also getting better and better. Swoole php blows out node js at asynchronous speed. PHP 7 is 3 times more faster than python.

1

u/msiekkinen Mar 07 '19

Mostly for server side web development. It's not necessarily and exclusive or thing between PHP and javascript either.

If you're doing front end web development you definitely need to know javascript. There are plenty of jobs listing php as a requirement

1

u/apptryer Mar 08 '19

This is something you hear from people who've only ever written something in Javascript lol. Yes, people still use PHP. Take a look at the frameworks Symfony, and Laravel. They're pretty popular for creating web apps with PHP and you'll be able to get somewhat of a feel for the amount of people still using it through forums.

1

u/[deleted] Mar 08 '19

sadly

1

u/captainkotpi Mar 08 '19

I'd say if you want to maintain older websites, you can go for it but you'd still have to learn Javascript on the long run. If you go Javascript, it is more modern and thus will net you newer projects. Both will have a good market share as PHP is very popular and is still now but it is very slowly fading (but will not 100% fade) away because NodeJS.

EDIT: Imo, learn master Python (it's great for comsci and web development) then other languages will be much easier to learn.

1

u/sicilian_najdorf Jul 31 '19

PHP is still number 1 at usage of server side programming language. It still holds 79.1%

https://w3techs.com/technologies/overview/programming_language/all

Php is also getting better and better.

-1

u/PM_ME_YOUR_REPO Mar 07 '19

PHP is not a good language. It is still in use, but if you don't need it specifically, learn anything else.

https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

1

u/apptryer Mar 08 '19

The hell are you talking about? I'm not a devout PHP developer or anything but that statement is just pure ignorance. PHP is old, and its not trendy like Node or Python but it gets the job done, and done well.

Edit: Btw, you can find an article like that for any opinion ever.