DEV Community

Cover image for The Snobby Demonization of PHP

The Snobby Demonization of PHP

Adam Nathaniel Davis on February 20, 2020

I'm probably older than you. My beard is grey. My experience is long. I've had the chance to witness many coding trends over the last 20+ years....
Collapse
 
jmfayard profile image
Jean-Michel 🕵🏻‍♂️ Fayard

Happy to share part of the 'shame': I built microservices in PHP and it was fine.

IMHO people should learn to give less fucks about the "right" way to build things and much more fucks about building the right thing.

Wikipedia for example is just a CRUD app built with PHP/MySQL. that's bad right?

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

(As you can probably already tell by my post) I completely agree with you. Of course, my post wasn't meant to say that PHP is crap. Rather, too many in the dev community (in the US, at least), seem to have adopted the viewpoint that PHP is a "script kiddie" language. So much so that it can actually be a liability to even mention PHP if you're in a job interview for any position that doesn't specifically call for PHP.

Collapse
 
jmfayard profile image
Jean-Michel 🕵🏻‍♂️ Fayard • Edited

i agree with you and I would
1) make a list of the most famous devs that built great things with PHP and ask the snobs whether they really think that they are smarter than those guys
2) treat this snobism as a red flag that I don't want to work here

Seriously it's not even about PHP

$LANGUAGE shaming *people" is stupid no matter what $LANGUAGE is currently hyped or not. Good people should try hard to not be that guy.

Collapse
 
stojakovic99 profile image
Nikola Stojaković

Well, it's much more than a simple CRUD app. Pretty much every web application out there is on the basic level CRUD, but there are many functionalities beside that.

Collapse
 
tomfern profile image
Tomas Fernandez

On my first internship they put me to write PHP, which I had never encountered before. Also, it was my first time doing web development. I think I learned the language in record time and did a passable job. I don't think I could have done with any other language at the time. PHP was pretty intuitive and easy to use. Whatever purist may say, PHP will always have a place in my heart.

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

I've been through "the good times and the bad" with PHP. It was the first web-based language I ever learned. And as someone who programs almost exclusively in the web realm, it kinda holds a place in my heart akin to my first love. When I first started using it (in the late 90s), you basically had two choices for web development - PHP or Perl. I'm sure I woulda done just fine learning Perl. But instead, I got on the PHP train, so my biases are set.

I'll freely admit that PHP's earned many of the arrows that are slung its way. 3.x was... embryonic. 4.x was a mess. 5.x was like watching a massive team of dike engineers working to improve the structure - but previous neglect was so great that they could barely keep ahead of the leaks.

FWIW, I think 7.x is actually... pretty damn good. I literally enjoy coding in 7.x. However, I'm rarely tempted to actually write much in PHP anymore because almost all my development has shifted to JS, which I can do for frontend (React) or backend (Node).

Still... I have WAMP installed on my local machine and there are numerous times when I go back to tinkering with PHP scripts.

Collapse
 
matronator profile image
Matronator

I'd be interested to read your opinion about PHP 8.x. Care to share?

Thread Thread
 
bytebodger profile image
Adam Nathaniel Davis

The first major caveat here is that, while I wrote gobs of PHP code for more than twenty years, it's only in the last several years that it's finally fallen almost entirely out of my toolbox. In general, I just don't have much use anymore for server-side scripting - in any language. So I can't claim to have written a single line of PHP 8.x code.

That being said, the list of new features added in the 8.x releases is... awesome. For example, if you look at the 8.x release page, almost every one of those features is, IMHO, a MASSIVE improvement, and they would make the language far more viable if I have the need again to reach for a server-side scripting language.

Thread Thread
 
matronator profile image
Matronator

Ah, I see, that's a shame. Or probably not, but you know what I mean 😅.

My experience with PHP 8 has been amazing, it's really on the right track to being considered a "worthy" backend language with the likes of C# etc (or at least Go or Python). One thing that still kinda brings it down are the messy built-in functions with inconsistent naming and parameter ordering that are kept unchanged to not majorly break backwards compatibility. I hope they would decide to finally sort it out some day, but I'm afraid that day will never come.

But definitely when you are ever in need of some server-side coding and have the opportunity, give it a try. It's almost a whole new language now from what it was back in 5.x and you'll be pleasantly surprised 😉

Thread Thread
 
bytebodger profile image
Adam Nathaniel Davis

Absolutely. Honestly, 7.x was a quantum leap in itself. And I greatly preferred using 7.x over any of it's predecessors. But yeah, 8.x looks to be even better - by leaps and bounds.

Collapse
 
jankapunkt profile image
Jan Küster

If a language has really issues or becomes useless it will actually disappear (see flash, which I really enjoyed to develop using the Flex framework).

However, I see both php and Js as languages growing and in a positive way. (Not comparable to the frameworks that are growing too fast and hype driven, mature tech gets labeled as dead etc.).

Collapse
 
bytebodger profile image
Adam Nathaniel Davis • Edited

I don't totally agree with this - because once a language reaches a certain "critical mass" of installed legacy codebases, it will tend to live, in some capacity, nearly forever. Flash died because there were almost no business applications that truly depended upon it. The vast majority of stuff written in it was for fluff-presentation - or entertainment. And that stuff can all be "turned off" if The Powers That Be deem it so. (By the way - I too did Flex dev - and I loved it. Sigh...)

But if your point is just that PHP isn't truly "dying" in any substantive sense, and thus it will never really "go away", then I completely agree with you. There are too many huge legacy systems (WordPress, Wikipedia, etc.) for it to ever truly DIE.

I also agree that PHP is growing and it's growing in a very positive way. But many in the dev community do not "see" it this way. And even though it IS growing, it's not growing at the same rate as JS. When I say "growing", I don't mean just the number of new LoC that are being written in it every year. I'm referring more to the rate at which new advancements are being made in the language. In this regard, JS seems to be lapping the field, IMHO.

Finally, seeing some of the early comments on this post, I realize that my viewpoint is very US-centric. I have noticed that PHP isn't quite the pariah in other countries that it is in the US. Outside the US, there are still plenty of people who see PHP as a viable language to learn and to use for new applications. In the US, I feel like this viewpoint is much different amongst the "senior developer" crowd.

Collapse
 
luiz0x29a profile image
Real AI

ActionScript didn't disappear because it had issues.
Steve Jobs shamed it out of existence.
He should have done that to PHP, I've personally wrote to him when he was still alive, but killing PHP wasn't in his business plans. PHP was harmless he said.

Collapse
 
valentinprgnd profile image
Valentin Prugnaud 🦊

I love PHP as well, but lately I have been using JavaScript myself, simply because it is easier and faster to “containerize”.

Having a strong, production-ready, light built-in server in PHP would be nice though and avoid having to deal with Apache/nginx/Caddy sidecars containers.

Collapse
 
bytebodger profile image
Adam Nathaniel Davis

To be absolutely clear, I have been veering heavily toward JS lately. And I've been loving it. I don't have anything against JS. And I don't have anything (irrationally) in favor of PHP. To me... any language is a tool in your tool belt. And it's silly to imply that the hammer is somehow superior to the screwdriver.

Collapse
 
kwstannard profile image
Kelly Stannard

I will admit I have a kneejerk reaction to PHP. My first job had a few people move off of an old PHP codebase to work on the new application and they would regularly complain about PHP. I then took a look at some PHP service's code and it was all procedural with global variables and whatnot. I have to remind myself that facebook is PHP and I probably just had an unlucky experience.

Collapse
 
afterdiv profile image
afterdiv

I love my personal homepages - using jQuery and css. Together they can make a great CMS tool and site. WordPress is simply an out of control template relying on compiled new and old components that don't work well with each other. I've never used a wp template because I'm a front end developer.

There is no shame in using any code language or markup language period. As long as the developer understand how it works and they can fix it, then they are a developer. People who use WordPress template are not developers.

Great
Thank You!