Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Again? Has it ever been a nice language?


For throwing a little web page together with a small amount of dynamicism, or for including headers and footers, PHP was great. For learning, it had just the right amount of power vs. ease of use.

Of course, PHP has all the well known crazyness and technical debt that drove many away. I now prefer Python, although the same thing is often a lot more verbose in Python than in classic PHP, I know I can maintain it better. "Modern" PHP with classes, stricter typing and templating engines is close, but it loses the easyness of drop-in `<?php ?>` .

Incidentally, I worked on a Wordpress site recently. It was a blast from the past and not in a good way. The coding conventions have not changed in decades, and it is `<?php ?>` and global variables all the way.


I worked on a Wordpress site a few years go, having to add a fair amount of plugins to spin up an MVP of a product we were testing. The incredibly goofy code I saw in those plugins was shocking. Things that should never have made it to production were in there; commented out blocks of code, TODO lines, random log output, complete nonsense comments.

Granted, I shouldn't throw the first stone - at least they didn't commit any obvious profanities, like I did when I was young. But it was just ... very clearly output very quickly.


Go write a better plugin if you've got a problem with it.

The users don't give a shit about any of those things.

The hate on WordPress and PHP by developers here astounds me. WordPress actually gives a shit about backwards compatibility. Unlike literally every modern JS or PHP framework I've used over the last decade has been an utter cluster fuck to keep in production.

Those WordPress websites I set up 10 years ago? Turn on auto updates and forget about it. Maybe 1-2 times I've had to resolve something on them.

Those react, Angular, Vue, laravel, express sites? They lasted a year before npm stopped being able to build updates hell they couldnt even build from a "lock file" (my fuckin ass it is).

What a waste of fucking time. All cause some dipshit kid thinks his "better" way of doing something is worth my time to update my websites.


This seems like a bit of an angry response. I write a lot of Wordpress and php code and help manage one of the most sold themes on theme forest. Php really was, in my opinion, a hell hole of a failed language until 6ish. The patterns people used as standard practice were 5-10 years out of date either due to the slow progress of WP or the php language and ecosystem. A lot of the flack PHP and Wordpress has gotten is totally deserved. Yeah it can just work, but at what cost? Maintenance and upgrading is terrible. Security vulnerabilities galore. You seem involved in WP but just work is a load of bullshit. Everytime we push an update people migrating are walking through a minefield: CSS overlaps, JS import overlaps, php bugs from other plugins. Going back, we can’t even use features from modern PHP because most of our users php versions aren’t well up to date.

Wordpress itself has done a terrible job halfbaking different systems as part of WP core. Gutenberg, imo, is just another abject failure that will take 5 years and provide a buggy solution. You are spot on with the compatibility argument which also has lots of pros and cons obviously.

Also for most js websites built at a certain time things weren’t using npm and bundles and you can simply link the js src like it’s 1999. Just save the source code and you never have to update.

I know this is a trope here but every job has the right tool. WP and php are great tools, especially PHP right now, it has literally never been better. WP on the other hand is just totally confused with Gutenberg and it’s clear Automatic has no idea what they’re doing and who their audience is.


As a full-time WordPress developer, I often do "go write a better plugin" when I have a problem with it. But that doesn't mean it's incorrect to say

> The incredibly goofy code I saw in those plugins was shocking. Things that should never have made it to production were in there

And the owners do

> give a shit about [many] of those things.

because the checkout will start to fail silently. One time for us, customers couldn't check out unless they entered an apartment number.

The standard of code in the WordPress ecosystem is sub-par.

Unit testing, static analysis and linting are NOT the norm.

Part of my routine is to read the error logs, fix the rookie mistakes introduced in plugin updates, and send the fixes back upstream. And when I say send, I mean email them or open a support thread on WordPress.org. It's a blessed day when the plugin is on GitHub for me to make a PR.


I write PHP, and I was shocked when I have to write WordPress plugin for the first time.

The forms API in WordPress, for example, require you to output HTml directly from the callback function.

Granted, it was a design that make sense 15 years ago, but I would have though there would be newer API.

It work fine, sure, but doesn't mean I have to like it.


When your preferred PHP alternative has produced as many open source killer apps, in terms of adoption, as PHP has I'll be all ears.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: