PHP will remain alive as long Wordpress is still being used.
But let's not forget that the WordPress codebase is absolute dogshit.
And not an example of how to write proper modern PHP.
Let's be honest though. The early PHP versions were absolute dog shit. And the definition of how not to design a programming language. That said, that never stopped anyone in web development from using it apparently. No clue what modern PHP looks like, apparently it's better now.
Modern PHP is better because it's modern. Which early version of a programming language was good? I've used a lot of them, and by modern standards, I think dog shit is a somewhat appropriate description for most of them.
It's one of a plethora of scripting languages from the '90s which were designed to be the antithesis of "fail fast" and kept going no matter what.
I guess what with C/C++ being the Mainstream Option at the time, not having to deal with a strict compiler must have felt like freedom. As someone who has had to maintain, cleanup and migrate ancient PHP code, I call it folly. That mindset of "let the programmer just do whatever and keep trucking" breeds awful programming practices and renders static analysis varying degrees of useless, which makes large-scale refactoring hard to automate which is just amazing when your major versions aren't even remotely FUCKING BACKWARDS COMPATIBLE.
PHP's original design is just fundamentally atrocious. It became popular in large part because unmaintainable code is usually someone else's problem.
A language that I would definitely use for server-side rendering and that was already good from its first stable release is Go. It was thoughtfully designed and lends itself really well to static analysis, while still being easy to write and decently performant.
I've never heard of a programming language that people don't consider shit
IMHO the killer feature was mod_php. Writing server-side website logic was stupid easy with that. I think if it weren't for that, php wouldn't have been nearly as popular.
I quit using it like 10 years ago, but I'm happy with what I did with it and got from it.
In PHPs defense, it keeps evolving in positive, meaningful ways. If you are up to date with it, it’s quite sophisticated and enjoyable. Doubly so if you use a framework like Laravel.
Most memes or jokes referencing a direct problem in PHP, are old or made by people who haven't touched the language in a decade(version 7 was in 2015, and it removed/fixed a lot of issues and added needed features).
There's also the huge looming thing that a lot of programmers forget: Websites like Wikipedia run on PHP, not to mention the amount of WordPress and similar websites are out there. Which means it will keep going strong. And for a while Facebook also used quite a lot of it, to the point where they made a rudimentary compiler instead of rewriting parts in more efficient languanges.
my entire way of reasoning about programming languages changed when i read on article about how hating on php was misogynistic. i clicked on it because it just sounded like yet another ragebait, but it made sense.
basically, since php is simple, and integrated with html, the vast majority of php devs started out as designers who later got into code. since php has always been a mess, nobody wanted to build mainstream tooling for it except the people actively working with the language. this means that mainstream ideas about language and tooling design didn't percolate down to php like it has done to most languages. so php devs, when exposed to tooling the rest of the world takes for granted, are usually overwhelmed because not only is there a lot of it, nobody in php-land uses tools like that. so they get called bad devs of a bad language. some of them, who really like to code, push through this massive difficulty spike, while others just assume that "actual programming" is too hard and go back to design, even though tooling usage has little to do with your skill as a programmer.
the kicker, of course, being that web design has more women than most other dev specialisations.
Is disliking something that (allegedly) is more popular with women than the average thing of its category anti-woman, even if no part of the complaint involves the user or their gender? The majority of users is likely still male anyway.
not directly, but trash-talking it and gatekeeping "real programming" from the language most likely to be used by women is not exactly conducive to improved equality in the profession.
i realise now that i didn't explicitly mention my point in the first post, so:
- shitting on other people's jobs is bad.
So PHP may be trash, but don't treat the people using it like trash? Makes sense to me.
In the start of my career I felt that there was a sentiment around web dev that it's not "real" programming in a way. Not sure if that's the case any more seeing as the majority of modern develoment is for web platforms.
I've never heard the idea that PHP is a language used by web designers who migrated to coding, but it kind of makes sense. How PHP works, where everything is just HTML until the <?php
tag comes in, made it so attractive as a way to add some spice to static pages. I cut my teeth on PHP and moved on to other languages later, so it makes sense that it would function as a gateway drug of sorts, also resulting in it not getting the attention from seasoned experts that other languages benefit from.
Calling dislike of PHP misogynistic feels like a massive stretch.. but maybe it's not considering how the designer/programmer divide also has a massive gender disparity. PHP has its problems, tooling being just one side of it, and its nature as a designer-friendly language makes it easy for elitists to mask their bigotry behind "objective" arguments that PHP is bad.
The main issue with PHP is that it’s designed for a pre AJAX web. Before when there was a real distinction between backend and frontend. The idea with PHP is that the server code is responsible of generating HTML on the fly.
Server code generating HTML is icky in modern web development.
it's what html was designed for. there's nothing icky about it. with htmx et al the serverside web is coming back in a big way so we can finally drop this react stuff.
Server code generating HTML is icky in modern web development.
There's been a big uptick in interest around SSR lately, so maybe not.
What's actually icky is making a website an SPA, duplicating business logic in the back and front, when it could perfectly be served as a server side rendered HTML.
What absolutely no. Server side generated code is still king in the right hands. Why have client lift all of thay when server side html rendering basically costs nothing. Even strong js driven front end you can still add much through server side by providing proper hydration paths. Good devs take advantage of both worlds but server side is incredibly powerful today.
Where I live, I still see people in a horse-drawn wagon. So, I guess horse-drawn wagons never died? It's only used for tourists and weddings, but that counts, right?
According to Tiobe, PHP was the programming language of the year in 2004. In 2010 it was number 3 in the top 10 programming languages. It's now out of the top 10 entirely. There really isn't a language that has completely disappeared. Mainframes are still programmed using COBOL, Scientists are still using FORTRAN, even Lisp, which has been around since the 1950s, is still going strong.
Maybe Actionscript counts as truly dead, since it was tied to Adobe Flash, and Flash is truly dead?
I have a lot of bad memories of PHP. It was, for a brief time, the main language I used, but it was so ugly and inconsistent. The only thing I loved about it, at the time, was that it wasn't Visual Basic. As bad as PHP was, at least I wasn't making web pages in that pile of hot garbage. But, I never felt joy writing something in PHP. At best it was a slog. At worst it was like pulling teeth.
Just about every other language has given me moments of fun. Original Javascript was a mess, but it already contained scheme-like features. It was sold as being an interpreted version of Java, but it had features that Java wouldn't have for at least a decade. C is a brutal and unforgiving language, but as long as you're not working with strings, it's great to have such low-level control over everything.
Maybe PHP has evolved like other languages, but I still am not interested in trying it out. Everything it was good at can be done better by other languages, and those are languages that give me joy, not pain. I hope it keeps dropping in the rankings so that people aren't exposed to it as one of their first languages.
Yeah, I think this is a more fitting meme to be about Java, because despite all the java is dead articles it's still like one of the top most used language, if anything is a serious backend service it likely runs on Java.
There are still Amish and Mennonite communities who use horse-drawn wagons and farm implements their whole lives.
Not really meant to be an argument to your point, just interesting to know.
Everyone in this thread: PHP sucks because it was bad when I last used it 20 years ago.
It's still bad nowadays, and it's the main language used on pretty much every system of several state level secretaries in Brazil. My colleagues work with it daily (I don't program, thankfully) and they're not exactly fond of it. Legacy systems, man
Backend devs: JS sucks because I never learned it actually
I mean it does suck, but it sucks less than anything else we have.
PHP is far from "least bad language". Nowadays it is an ok language, one of many. You can also write ok code in it. The main issue is that it's really easy to write horrible shit that just barely works and will break when you look at it wrong. In fact without a lot of knowledge and experience that is the code you will probably write.
There are much better languages for any webdev niche you can think of, and some that are just better for webdev overall (e.g. Elixir). The reason PHP is still relevant is mostly huge legacy codebases that require a lot of engineering power to maintain (because PHP is not a good language for maintenance).
The way I look at it is that PHP is the C++ of webdev (but slightly worse).
It's old and ugly, the worst tool you can use for anything, and unkillable.
Ah yes, the language that picked strlen as the hash function for its hashtables.
Javascript is living proof that your language doesn't need to be good to be used.
I tripped over this one in Delphi the other day.
function AnsiStartsText(const ASubText, AText: string): Boolean;
function AnsiEndsText(const ASubText, AText: string): Boolean;
function AnsiContainsText(const AText, ASubText: string): Boolean;
PHP will never die. As long as code is written there will be PHP developers there to claim it's good now.
Happy 44th birthday IPv4! 🥳
this is perl erasure
also php didn't cause the internet to suck; overreliance on javascript (and js based frameworks) did. there's a reason that modern internet is so slow and clunky and it's not php. at least php has the capabibility to improve over time not degrade.
Well, at least PHP isn’t as bad as JSP.
Replaced the P in LAMP with Python when I started building webpages again a few years ago, and never looked back. Such a vastly more pleasant experience.
I am an advocate for LKPPR (Linux, Kubernetes, Postgres, Python, React). Doesn't roll off the tongue that well.
bro ive been doing fullstack js dev for severals years to then realize php is superior💀
It's true that the fuckers that stayed in PHP now are getting paid insane amounts of money to maintain systems? I've heard they are the new cobol people.
Maybe 25 years ago i build my first website for a paying customer ( my dad). I decided to go for php which was new to me at the time.
I figured it would be too risky ( even back then) to have PHP generate dynamic pages so instead I had php generate static html.
So whenever website needed updating , for example a new folder with images was added, you could just load the admin.php and it would generate gallery pages for you.
Would probably still work 25 year later if wasn't eventually replaced with some WordPress or something
for many websites, this is the ideal way to do it
makes it order of magnitude more secure
And performant. And accessible. And compatible.
Array_filter and array_map having the arguments swapped pisses me of so much.!
Yup! Every time we add a new technology, the old does not go away. We just have more (gestures wildly) everything.
When picking a career specialization, don't abandon all the old stuff. Some of it makes a lucrative career after others have moved on (HPC, COBOL, on-site servers).
Programmer Humor
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics