PHP Is Better Than JavaScript, And I Don't Care If This Starts A Fight

php dev.to

PHP Is Better Than JavaScript, And I Don't Care If This Starts A Fight

A few years ago, if you told me I'd eventually enjoy writing PHP more than JavaScript, I would've laughed.

Then I spent more time working with both.

Now here we are.


PHP Just Wants To Build Websites

PHP knows exactly what it is.

It's not trying to become an operating system.

It's not trying to become a game engine.

It's not trying to run on my toaster.

PHP wakes up every morning and says:

"Need a website?"

And that's pretty much it.

I respect that.


JavaScript Has Main Character Syndrome

I swear JavaScript cannot sit still.

Originally it was supposed to make buttons do funny things when you clicked them.

That was the job.

That was literally the whole job.

Then somebody decided:

"What if we run JavaScript on the server?"

Then:

"What if we make desktop apps?"

Then:

"What if we make mobile apps?"

Then:

"What if we make AI tools?"

Then:

"What if we use JavaScript to build tools that generate JavaScript?"

At this point JavaScript feels like that one friend who joins every project whether you invited them or not.


PHP Lets Me Get Stuff Done

This is probably the biggest reason.

When I'm writing PHP, I feel like I'm solving my actual problem.

When I'm writing modern JavaScript, I sometimes feel like I'm solving JavaScript.

There's a difference.


The Dependency Situation Is Crazy

I once cloned a JavaScript project.

Ran:

npm install
Enter fullscreen mode Exit fullscreen mode

Went to make coffee.

Came back.

Still installing.

Checked the folder size.

The dependencies were somehow larger than the actual application.

How?

Nobody knows.

Nobody asks.


PHP Projects Feel Weirdly Peaceful

With PHP, it's usually:

composer install
Enter fullscreen mode Exit fullscreen mode

Cool.

Done.

Let's build something.

No seventeen bundlers.

No mysterious transpilers.

No "you need version 18.2.7 but not 18.2.8".

Just code.


JavaScript Changes Every Five Minutes

Every time I come back to JavaScript after a few months, I feel like I skipped three seasons of a TV show.

People are suddenly using a new framework.

Half the syntax looks different.

The recommended architecture changed.

The cool thing from last year is now apparently bad.


PHP Feels Boring

And I mean that as a compliment.

I love boring technology.

Boring technology pays bills.

Boring technology stays working.

Boring technology doesn't suddenly become obsolete because a YouTuber uploaded a 30-minute video titled:

"Why Everything You Know Is Wrong"

PHP is boring.

And boring is underrated.


The Funny Thing About PHP

For my entire programming life, people have been saying:

"PHP is dead."

Every year.

Without fail.

Every single year.

And yet somehow PHP keeps showing up to work.

At this point PHP is basically that office employee who's survived six management changes and somehow still has the same desk.


My Completely Scientific Comparison

PHP

  • Write code
  • Refresh page
  • See result
  • Life is good

JavaScript

  • Install dependencies
  • Update dependencies
  • Fix dependencies
  • Read dependency changelog
  • Update dependencies again
  • Finally write code

Before The JavaScript People Attack Me

JavaScript is genuinely useful.

I use it.

Everybody uses it.

The web literally wouldn't function without it.

This isn't a "JavaScript bad" post.

It's more of a:

"Can we please stop pretending every problem needs 400 packages and a new framework?"

post.


Final Thoughts

PHP isn't perfect.

JavaScript isn't terrible.

But when I need to build a website quickly, connect a database, and get something online without summoning the entire modern frontend ecosystem...

I still find PHP refreshingly simple.

Maybe I'm getting old.

Maybe PHP got better.

Maybe JavaScript got too complicated.

Or maybe I just enjoy technologies that let me spend more time building things and less time reading build-tool documentation.

Either way...

PHP still deserves way more respect than it gets.

Now excuse me while I open a JavaScript project and download approximately 8 billion dependencies.

Source: dev.to

arrow_back Back to Tutorials