DEV Community

Discussion on: Why developers hate PHP

Collapse
 
andreidascalu profile image
Andrei Dascalu

I'm sure there are people that hate PHP, but "hate" is a pretty big exaggeration in a world where: a) you can change the tools you use anytime and b) things evolve over time.

The only people who can say truly hate PHP are:

  1. developers stuck on old versions and prevented from evolving alongside the language by their projects (thinking of WP developers mostly, though I'm sure there are plenty of legacy projects in maintenance). There's some ripple effect here because developers stuck with antiquated practices and versions tend to stick to bad (and old) practices they need to unlearn later. This brings a different kind of hate that affects the image of the language.
  2. lazy people who can't get themselves to learn something else. You don't like it, get a grip and learn something else. Nobody's forcing anybody to get a mental breakdown.

Otherwise, yeah, PHP is plenty bad:

  1. language inconsistencies - they tend to get solved, PHP > 7.2 is great and > 8 can actually stand alongside any language but it's hard to argue evolution when plenty of old versions are in use and plenty of developers are rooted into those.
  2. it's bad for microservices (deployment wise, but also performance wise) due to being dependent on external tooling (eg: third-party webserver like nginx or apache or others). It's a headache to make an efficient small microservice under Kubernetes with PHP.
  3. Wordpress - yes, it powers a lot of current internet which means it can't evolve even when PHP does. While wordpress supports new php versions, its API won't support new language features, making any WP custom codebase even messier than it already is (you can, by any means, use new language features - but consider a developer working on a WP module -> they will take cues from existing codebase).

I would take PHP over Python any day, I would take PHP + Roadrunner for some microservices over NodeJS (though this means the only frameworks I'd use are Symfony and Spiral which workd great with RR, while things like Laravel are awful to maintain and have poor performance when compared) but otherwise I don't see a reason to go with PHP if there's a choice (myself I can use one of Go or Elixir ... so why would I choose to start with PHP unless I'm aiming at server-side rendered monolith?)

Collapse
 
thinsoldier profile image
thinsoldier

Could you point me to a good tutorial in any language on how to maximize search engine friendliness when not rendering content server side?

Collapse
 
andreidascalu profile image
Andrei Dascalu

Sure.

snipcart.com/spa-seo

And a great one on Google's playground. codelabs.developers.google.com/cod...

Details of SEO change quite often as various search engines change how they deal with static content (which SPAs technically are). Google is by far the friendliest engine but there are also some other details.

Sure, it's somewhat harder.

But then again server side or not, it's not really related to the PHP discussion.