5 ms·
I think while this is true, one thing that was lost with PHP style development is a model that's an easy stepping stone from "a directory full of HTML files".
by ryanbrunner 4y ago
I think while this is true, one thing that was lost with PHP style development is a model that's an easy stepping stone from "a directory full of HTML files".
With PHP (and other things like classic ASP) the model was the exact same - it's just that instead of an HTML file, you would request a PHP file and then that would be what was run. The output of that file is what the user would see.
With modern-day backend frameworks, that relationship is severed. Your user makes a request, it goes through a bunch of "stuff", and ends up executing a function. How that happens isn't nearly as obvious. It's learnable for sure, but it takes what is a 5 second explanation to something that most brand new developers chalk up to magic for a while.
- ad404b8a372f2b9 4y agoDefinitely, it's been a source of annoyance for me with Phoenix. While the default request flow is fairly simple (router -> controller -> view), they have the concept of "plugs" which are functions applied conditionally at different steps and which can be defined in a whole bunch of places far away from the functions meant to handle a specific page. It makes the whole request lifecycle very confusing and when an error arises you find yourself in a completely different part of the callstack than you expected, calling some magic function you didn't even know existed.
- philihp 4y agoA good framework hides all of this, and gradually reveals how it works to the user/coder. I think Next.js does this very well, although I'll admit that their "getting started for total beginners" documentation spends way too much time explaining the magic. If I were to throw someone into the deep end to make their own mistakes, as I assume we all did with PHP, I would tell them to git clone https://github.com/vercel/next-learn/tree/master/basics/learn-starter https://github.com/vercel/next-learn/tree/master/basics/lear..., and then experiment with "pages/index.js". Hot reloading that you get out-of-the-box with most JS frameworks is a massive improvement over static HTML, or PHP.
- ryanbrunner 4y agoNext does a really good job of emulating what worked about the PHP model while still having a framework behind it.