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

The point of php was to not be ”good”, but to be practical. A simple way to add some logic to html.

Write a few lines, upload it, boom it works. Quick and easy.

There is a place for typed & strict languages and a place for pragmatic ones.

But php got shamed for it so badly they got into an identity crisis, for the last decade it’s slowly been trying to become Java and do everything correct.

Same with Wordpress, before I could just make a plug-in with one php file & a few lines. Now I have to create a separate npm project and build for every tiny change



PHP got shamed for these things because people built complex, and over time unmaintainable, systems in it.

Mind you, the "old ways" still work - you can still write a few lines, upload it, boom it works. Projects around PHP might have developed different ways of working, but that's because of problems in the old way - and that's not a fault of PHP, it's a plus that things move in a more maintainable and type-safe direction. You even reap some benefits when doing a "write a few lines, upload it, boom it works" workflow.


Yeah it's great that it still works, and should!

That's not to say PHP isn't been overcomplicating itself & hasn't fully embraced why it's so succesfull and improved that part: it's easy & practical.

How can it be even easier? For instance even simpler hosting? With things like vercel, and app engine PHP isn't necessarily the simplest choice in hosting sites anymore.

A Vercel for PHP would be awesome.


> That's not to say PHP isn't been overcomplicating itself & hasn't fully embraced why it's so succesfull and improved that part: it's easy & practical.

Do you have specific examples for things where PHP has been overcomplicating itself? Most complex things seem to actually make things easier for newbies (e.g. typing can be a great help).


And as a legacy dev you can just ignore all of those new things. You do not have to use lavarel or any of the latest, greatest frameworks or features. Your code from 15years ago will just work as well.


>PHP got shamed for these things because people built complex, and over time unmaintainable, systems in it.

Because it was very accessible for people to get into it without being you know, a 10 year programming veteran at least.

Now all those newbies are out creating 400 npm dependency projects heh


> Because it was very accessible for people to get into it without being you know, a 10 year programming veteran at least.

Sure. Wouldn't it be nice to allow these people to write better code without having to change their language?


You can still make a Wordpress plugin with one php file and a few lines? If you want an npm project and build chain you can have that, but you can absolutely still build a Wordpress plugin with a functions.php file and nothing else


The old way yes, but if you want to integrate with a block them you can't. The Gutenberg thing is overcomplicated, which is why it's not really taking off.


Gutenberg has been a nightmare from the beginning. Saving structured data into the post HTML field severely limited the benefits of migrating content into blocks. Last time I checked, getting block data via the REST API wasn't officially supported, so making a headless site requires extra plugins.

When you reach that point you may as well be using ACF, as it's so much simpler and doesn't require rebuilding frontend scripts anytime anything changes.


There's no rule that says that something can't be both practical and good.

And it's not like it's no longer possible to write quote-unquote "bad" PHP -- if nothing else, PHP is backwards-compatible to a fault.


> But php got shamed for it so badly they got into an identity crisis, for the last decade it’s slowly been trying to become Java and do everything correct.

PHP was a dumpster fire. It's not "pragmatic" to have trivial SQL injections everywhere that are difficult for non-experts to fix. It isn't "pragmatic" to have user hostile error messages. It isn't "pragmatic" for different parts of your standard library to disagree about core design principles. It's a hundred different recipes from around the globe just thrown into a blender for a few seconds in the hope the result will be "fusion cuisine" when it's barely even food.

I wrote a whole bunch of PHP ~15 years ago for money, and before that I wrote some for the comedy site friends and I ran in the 1990s, I also had the misfortune of picking up a card in my scrum the other month where I had to modify some PHP. It's changed. It hasn't changed anywhere near enough to justify itself.

I would rate PHP3 era PHP as a 0/10 maybe just use static HTML instead, and modern PHP is maybe 3/10 where it's better but it's just not better enough to use if you could pick something else.




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

Search: