Hacker News new | ask | show | jobs
by sacks2k 2243 days ago
"I do think that one of the big problems for PHP is that people who voluntarily do PHP instead of something else are immediately suspect"

I write lots of PHP for work and for most of my personal projects. Learning other languages is just syntax, when you know the core concepts.

I once converted a personal project over to Python 3.X in a couple of weeks and it was much slower and took more memory than the PHP counterpart, so I scrapped it.

"However, most PHP I run into is not modern"

This may be the case for you, but I've worked with lots of companies that built their apps using PHP and most are modern.

"but I can't really imagine doing it myself just because of all the flashbacks to code that parses query parameters and calls the database in the middle of a templated for loop"

I'm sure there were many poor practices with other languages 20+ years ago.

I think many here on HN are living in a bubble where most companies use cool new frameworks and are looked down upon for their stack choices.

I haven't been out of work in the past two decades, and I work almost exclusively with PHP code bases. I suppose I should be happy for all of this language snobbery, because I make a very good living and haven't spent more than a few days between gigs.

2 comments

> I'm sure there were many poor practices with other languages 20+ years ago.

I agree with most of what you wrote, but not this. Code written in PHP from the 5 and before era was bad in a unique way. Before it came bad VB and now there is a deluge of bad React. That’s what happens when a language is popular with inexperienced programmers. But bad PHP was bad and insecure by default, which led to a ton of security bugs. The only thing comparable is C, which has had tons of buffer overflow security bugs—but those were written by pros. ;-) I can’t think of anything else web facing with so many problems with SQL injection and string escaping. The problem was that making a webpage by naive string interpolation is a bad idea, but it seemed like a good idea and it’s what PHP did best and why it was so popular. PHP was lucky to be the wrong paradigm at the right time to take off like a rocket.

Modern PHP is MVC-ish like everything else, but without the simplicity of stupid string interpolation, it can’t attract users like bad PHP used to.

I think the parent comment is just describing some of the perceptions they've seen about PHP. I've done PHP work, but I've noticed the same perception. Also in my area, there's a lot of PHP work, but it's generally much lower paid. I know a lot of tech people here, and some of them are writing really modern PHP - for much lower pay than a .NET developer at a comparable job. It's definitely possible to do great work in PHP, and it's also definitely perceived (rightly or wrongly) at least in some circles to not be awesome.