4 ms·
I wonder if there's a way to do server-side javascript programming with this philosophy. For client-side I can just throw together some html and javascript to
by bogdanoff_2 5y ago
I wonder if there's a way to do server-side javascript programming with this philosophy.
For client-side I can just throw together some html and javascript to make a simple app. But if I want to use javascript on the server it seems like I need to download a bunch of npm dependencies to do anything useful.
- WA 5y agoSure, you can do it on the server with Node. Node has `http` as part of its standard library and you can write a simple webapp without third party dependencies. Check this tutorial for example [0]. The problem is that Node's http lib isn't super productive and you gotta write some "solved" stuff like cookie handlers. Also, there is no database standard library. If you want to persist data, you could use files. If you need a database (even SQLite), you gotta use third-party stuff. In comparison, PHP has a lot of stuff build-in and you can be more productive with zero dependencies in PHP. But then, maybe it doesn't really matter if you include a well-maintained npm package or if you have a more powerful standard library that has some features deprecated after a while. It's still "other people's code", although npm packages require some kind of installation, whereas a standard library usually doesn't. [0]: https://www.section.io/engineering-education/pure-node-js-no-frameworks-or-packages/ https://www.section.io/engineering-education/pure-node-js-no...
- tored 5y agoThere was a trend a few years ago (maybe still going) that languages with a large standard library, like PHP, is bloated. That we should strive against minimalism and then just share dependencies when needed. But then the nodejs left-pad debacle happened. I used to be more on the minimalist side, but over time I have switched to the opposite, today I can really appreciate the bloated nature of PHP, everything from large projects to small scripts just becomes easier to handle.