Re:PHP 7 Virtual Machine
by bpicolo on Monday April 17, 2017 @07:53AM
(#14130330)
Every web framework out there (express + nodejs included) will handle exceptions properly and not blow up the server on exception.
[ Parent
| on HN ]
You're not refusing my point by insisting on adding more complexity (a huge framework), when simplicity and rapid prototyping of a small script was the goal.
This question is what I mean, extra stuff one has to keep in mind: http://stackoverflow.com/q/5999373/923847 Does it matter for a real project? Probably not, just some boilerplate. Does it matter when I want something quick up and running? Yes.
> a huge framework
I contest the idea that sinatra-style frameworks are "huge".
Python + flask is about as low-overhead as one can get. No need to set up any extra (apache || nginx).
PHP's model of "just chug along returning null" by disabling most relevant errors is a massive antipattern in production code.
PHP has lower overhead still. You don't need to import, explicitly define route, etc. PHP Built-in dev server doesn't require anything extra either.
I mean, it's "different", but I think it's a stretch to say lower. PHP overhead is suddenly a lot higher when you need a route with a dynamic ID in it if you're talking pure out-of-the-box, for example, which is a reasonably trivial use case.
Express can't catch an exception thrown in a callback cleanly.
It doesn't crash the server, though, is the point.