Hacker News new | ask | show | jobs
by young_unixer 1886 days ago
The fatal flaw of this article is assuming that having a single PHP file implies ugly code, or at least uglier than the average codebase.

I would, in fact, guess that its code is much cleaner than the average Fullstack Javascript app.

If you're capable of writing a full, functional website in one PHP file, you know what every line of code does, you have only what you need and the ways to factor your code become more obvious.

Using the "modern" Javascript stack usually means that you had to spend months or years trying to learn this mishmash of Javascript libraries (React, react-redux, Express, an auth library, an ORM, etc.) and you don't know what most of those things do under the hood.

The lesson I take away is: Simple (PHP + Jquery) can be better than complex (React, Redux, Express, Passport, etc).

2 comments

I've spent some time trying to pick up modern JS tooling. I used to code JS back in the early days of JS and stopped around the time Backbone JS stopped being used

The learning curve right now in JS is ridiculous. Onboarding developers is hard. We wrote a new project in ember js and threw it away for react.

Sometimes new tools, like Ruby on Rails, make it way easier to get started. Not so with JS. But I'm sure you get a lot of dynamic rendering power to make up for it

If learning a couple of basic tools like an ORM and JS build tools is too much of a barrier, you probably shouldn’t be let anywhere near a database with real users data in it.

PHP is too easy to get started with and let’s you do some truely horrific things trivially.