4 ms·
I like how this tutorial walks you through setting up a babel config with node. Too often I see tutorials that just assume you're transpiling your node server w
by _hardwaregeek 8y ago
I like how this tutorial walks you through setting up a babel config with node. Too often I see tutorials that just assume you're transpiling your node server with all the fancy stage 2 features like decorators.
However, as with most node tutorials, I end up bored when it comes to persistence layers. Like why do we need to set up Postgres for the millionth time? Why do we need to connect the ORM to the database and explain to it how the models are associated? Maybe I'm just spoiled by Rails, but a lot of this stuff is fairly universal and should probably be automated.
- sbr464 8y agoI tend to agree but I’ve personally stopped using popular ORMs and instead my own semi-reusable, lighter weight libraries that are closer to the native db drivers. I feel like in this longer form writing, having the complete process laid out offers more consistency and understanding of how things work. I also think it’s a no-win situation for an author; use a library/ORM and get an equal amount of negative feedback.
- aikah 8y ago> I tend to agree but I’ve personally stopped using popular ORMs and instead my own semi-reusable, lighter weight libraries that are closer to the native db drivers. One could argue that GraphQL libs like Apollo are ORM by nature. So you're just kind of shuffling things around but you're still using an ORM. ORM is a complicated problem to solve, that light-weighter libraries don't solve, but at the same time ORM can't replace usage of SQL either, as soon as it's time to optimize queries or use dedicated functionalities not covered by an ORM library. Fortunately, some databases are now better at returning complex multidimensional datas using object aggregation functions in order to avoid N+1 queries, unfortunately, most do that in a proprietary way and the standard totally lacks on that aspect.
- _hardwaregeek 8y agoYeah, the author handled it nicely, and overall this is a fantastic tutorial. I'm wondering more in terms of the Node ecosystem as a whole.