DEV Community

Discussion on: What’s an unpopular software opinion you have?

Collapse
 
pavlosisaris profile image
Paul Isaris

You can write good quality code in PHP :)

Collapse
 
jackharner profile image
Jack Harner 🚀

I love PHP. It's the thing I've spent the most time with so it's what I'm most comfortable with.

I'm starting to learn React and playing around with Python a little bit at work, but PHP is what I've always used and always want to come back to.

Collapse
 
pavlosisaris profile image
Paul Isaris

Exactly, that was my point. you can write clean code in any language ;)

Thread Thread
 
anortef profile image
Adrián Norte

Of course you can, do not let anyone tell you otherwise. Most of the time when people bash PHP it's because the scenarios on where it is the ideal language to use are very narrow.

Thread Thread
 
thehanna profile image
Brian Hanna

Or because they haven't used it recently. PHP 7 really turned my opinion around on it. As did Laravel

Collapse
 
mccabiles profile image
Miguel

Does it count if I use a PHP framework? I mainly use Laravel :D

Collapse
 
pavlosisaris profile image
Paul Isaris

Me too ;)

Collapse
 
evanroggenkamp profile image
Evan Roggenkamp

Laravel is awesome.

Collapse
 
erebos-manannan profile image
Erebos Manannán

Really, PHP as a language is so restricting that there are a lot of things you simply cannot and should not code in it. Additionally the whole design for the typical use of the language - a collection scripts that get evaluated from start to end for every web request, triggered by access through a web server - is so bad that it has lead to countless incredibly misguided design decisions and massive numbers of hacks and other issues.

As an example, there's WordPress having all the modules deployed under the public folder and then access to them gets you direct "access" to the code, so all you need to find is one ignorant developer's one bad module and scan the world for all installations of it to hack a big pile of websites. This is the legacy PHP has given us.

Add to that the fact that the language has countless really bad design choices, that simply waste your brain power in useless things - does the function have underscores, does it take haystack before needle, and other such questions constantly waste your time when they could be standardized, and the language community simply refuses to fix their countless past mistakes keeping "backwards compatibility" as some sort of gold standard that must never be sacrificed.

In short: Yes, you can produce code that is better than WordPress in PHP, but you can never be a good programmer while using PHP - you waste too much of your time on things other than producing good code.

Everyone really should read this if they haven't eev.ee/blog/2012/04/09/php-a-fract...