DEV Community

Discussion on: Quick ramp-up with NodeJS

Collapse
 
lauravuo profile image
Laura Vuorenoja

I heard that people were superinspired by your presentation, so good job!

I have used Koa only once before in a small project, with Express I’ve played around more. How would you compare the two?

Collapse
 
bias profile image
Tobias Nickel

I like express more. In koa the router middlewares are just to hard to use. I also use a solution with async middle wares in express, than the code also becomes much cleaner.

Collapse
 
matrixx profile image
Saija Saarenpää

For me, probably the best thing so far has been the native support for async/await. For Express I had to use a wrapper to hide the usage of callbacks. I don't yet have a strong opinion if it's better or worse that Koa replaces the request & response objects, which I think is the biggest difference in use when compared to Express.

Thread Thread
 
bias profile image
Tobias Nickel

for sure you can be productive and complete your projects successful with either of these.👍

Collapse
 
matrixx profile image
Saija Saarenpää

Thanks! I have only used Koa quite recently so I don't have any strong opinions. Also, it's not necessarily something I would use in production if I were now to start a new web project, though some people would say the same about Node 😂 The reason I first started to look into Koa was its native support for async/await. And secondly, I just like to try new things. The usage does not differ much from Express, and maybe the most notable difference is that Koa replaces Node's native request and response objects with it's own counterparts. But that much you already know. I've not yet decided if that's a good or a bad thing. Some say it's easier to handle errors with Koa, but I still need to do some extensive error handling myself to see if it adds up.

Collapse
 
lauravuo profile image
Laura Vuorenoja

Ok, thanks for the analysis ☺️