by skor · 6y ago · 0 comments
What about its die-hard intention of fulfilling a request no matter what? What about autoloading? And what about the amount of things you can do in vanilla PHP, no libs, no extensions.
Hey i've worked with it for some time and sure, its got its nasty things, like gotos :)
This applies not only to php of course.
Also, I'm one of those guys who was lucky to do enterprise react projects before it was a thing, and even converted a huge react codebase to typescript, and I'm telling you: If it takes 10 seconds instead of 2 for a giant codebase, there's a misbehaving plugin or a misconfugiration. Shed all of them and also explore hot module reloading.
My nodejs app (not react) restarts in about 3 seconds, which is still hugely annoying as I can hit reload after alt-tab in a second and I have to wait a few seconds or else I get "Bad Gateway" errors.
It's monitored by pm2 for auto restarting ts-node.
I wish there's a better solution that reloads faster than you can alt-tab and reload.
How popular is the functional paradigm for The Web?
(reference: "I had implemented several iterations of what eventually became React, in a few languages - one of the first explorations began as a rough implementation of the reconciler and component model in [the functional language] Standard ML (CreateClass was a "module function"). This was really great because SML embraces immutability by default which is natural when building React style components. " - https://www.reactiflux.com/transcripts/jordan-walke )
But it also has some security benefits - with that model it’s harder to have exploits (as in your request you don’t carry over any other state), session swaps, no need to care about concurrency, locks, etc.
It’s by accident, but it’s a real benefit of php.
pm2 with ts-node is the best I can achieve so far but not fast enough not to hold for a second.
Everything else as an autoreload of some sort, so you don't have to think about it while developing.
I did a talk about this a few years back: https://www.youtube.com/watch?v=bl8jQ2wRh6k