top | item 45989855

(no title)

calpaterson | 3 months ago

A lot of people are too proud to be associated with PHP. I am ready to admit that know nothing about the language except that a lot of people make cool things with it.

My favourite PHP product at the moment is BookStack (https://www.bookstackapp.com/), a really good wiki. I run an instance for my family and it's great.

But there are loads of things. And I notice that many of the sites I like using...are built on well maintained PHP stacks.

discuss

order

jjice|3 months ago

Modern PHP is a damn fine, fast language. I wrote production PHP from 2021 to 2023. The problem with PHP wasn't the language or the ecosystem (PHP community packages are very solid in my experience), it's the existing PHP code you'll work with and the people that hire for PHP.

My salary literally doubled within two years of getting a gig that wasn't PHP. If you see a listing for PHP dev work, there's a good chance it's notably lower salary. There are still solid gigs for it, but I swear they lean lower.

The other problem is the existing codebases. There is some awful legacy PHP 4 era code. There are also a lot of practices that old PHP had that are just awful to work with, and there's a bit of variety in there. So many bad data access patterns out there. Many of old PHP codebases have their own spin on that kind of thing.

I understand this isn't actually due to the language, but there is a real correlation (in my experience) between old bad code and it being in PHP. Which is totally fair because it was a good tool to reach for to "get shit done (r)" and that code was successful enough to have to continue to live.

Modern PHP has, thanks to the core language and the big frameworks, made it wonderful. I lead a big push to go from PHP 5.8 to PHP 8.1 at the time at my last company. It was wonderful. The quality of the code we were enabled to write was huge.

If I was starting a new project today, I probably wouldn't reach for PHP, but I'd gladly join in on a modern (last ten years) Laravel project.

nusl|3 months ago

PHP is a very pleasant and straight-forward language to work with. I enjoyed my time working with it, though I did also see quite a lot of very poor code.

I think the danger with PHP is more its ability to easily cause *very bad things*.

This would partially be poor training (my University literally taught PHP with SQL-injectable examples), and I think the language itself making it very easy, such that less-experienced developers using it - most of them, early on - don't realise what's wrong until it's gone wrong.

With PHP being such an early tool online, and the above properties existing, it earned a reputation for being insecure and bad.

ale42|3 months ago

> I think the danger with PHP is more its ability to easily cause very bad things.

Is there any language where you can't?

Cthulhu_|3 months ago

At least in my experience, the early years of PHP was lacking more enterprisey users; back then there was a small revolution when RoR came out and introduced the MVC pattern to a lot of (web) developers, who didn't have as opinionated a pattern / architecture up until then.

During that same period, there were a lot of mediocre tutorials and documentation online, including on the PHP website itself which allowed people in comments to post code examples, but as far as I know there wasn't a lot of moderation on those.

And finally, a lot of people ended up writing their own frameworks and the like, because they could. But also because there weren't any or not many good and widely adopted frameworks out there, that came later with first Zend Framework and then Laravel, the latter being the de-facto standard nowadays.

khannn|3 months ago

I miss doing drive-by SQL injection attacks against my classmate's string concatenations with bonus no input validation queries

rob74|3 months ago

I'd take PHP instead of JS/TS + framework-of-the-day on the backend anytime. Ok, PHP is usually also paired with a framework (cough Laravel cough), but at least there the situation is more stable, not to mention more mature. Unfortunately, I'm not the only one making the decisions...

kijin|3 months ago

PHP is a reasonable choice if you care about writing something that will still work out of the box 10 years from now.

But of course this assumes that you work with a team that can see a year ahead, let alone 10.

etothet|3 months ago

I’ve made my living amd career off of PHP and I enjoy its modernization.

Coding in PHP can be a lot like playing the guitar or writing poetry: many people can do it, but it’s easy to do very badly.

nake89|3 months ago

> A lot of people are too proud to be associated with PHP.

How so?

misiek08|3 months ago

A lot of mediocre devs sitting at corporations that migrated from PHP to Java and currently can’t write relatively good code in any language make jokes of PHP, because it was popular for some time. They won’t admit the language gave them food, they have no idea how language looks today and are way too proud to admit any of that.

type0|3 months ago

Vanity, it's "PersonalHomePage" language

bawolff|3 months ago

> My favourite PHP product at the moment is BookStack (https://www.bookstackapp.com/), a really good wiki.

Another wiki that uses php is Wikipedia.

People like to shit on php but it powers some of the largest sites in the world.

At the end of the day, programming language doesn't matter much. You can be a good programmer in any language and a bad programmer in any language.