DEV Community


Discussion on: Imposter Syndrome: PHP Edition

xowap profile image
Rémy 🤖

Well no, JS became good at client-side.

  • Decent libraries came up
  • The DOM API improved a little bit
  • More tools in the language (let/const, generators, sets, etc)
  • Newer version being backported through transpiling
  • New ways to avoid the callback hell (promises, async/await)
  • Better ways to integrate with CSS (custom properties)

Overall, JS became very fit at being a click handler.

On the other hand, there is no area where PHP shines. All new features are half-assed and just trying to copy the cool kids.

Just take ?? (introduced in 7.0). It's called the "null coalescing operator", yet the doc says it's equivalent to using isset() and not is_null(). That's also a reminder that isset() should get the same underscore as is_null(). Inconsistency is a fucking design pattern in this language and it certainly has not been cured.

That's why people don't hate JS anymore but still hate PHP.

Thread Thread
thinsoldier profile image

Decent libraries also appeared for php via composer & packagist.

PHP also got more useful tools built into the language like try/catch, generators, yield, finally, Constant array/string dereferencing, simpler password hashing, more internationalization time and date features, ... operator, namespace improvements, variable type declarations, return type declarations, array constants, anonymous classes, improvements around anonymous functions, more OOP features.

As for isset() vs is_null()... I just type "is" into any of my IDE's and they both show up as options. IF I were to type out isnull manually I'll immediately get an error warning. Were you writing PHP in notepad or something? Inconsistency in PHP will NEVER be cured, just like the bad ideas in JS or the DOM will never be cured. New things will be added on top and it will be up to the developer to remember to not use the old things.

I can appreciate your hate of PHP because you have experience. I'm just tired of people talking smack about one but not the other when anyone with enough experience should really be able to fairly explain what they hate about both.

Forem Open with the Forem app