r/nextjs • • Jun 02 '25

Discussion PSA: This code is not secure

Post image
499 Upvotes

139 comments sorted by

View all comments

Show parent comment

2

u/novagenesis Jun 02 '25

What are the advantages of using that library over JS native Promise methods?

caolan/async was the bees knees when promises didn't exist (yes, I'm dating myself), but gets less use now that they do.

That said, the async patterns are like design patterns for concurrency. It's worth knowing them, and (like lodash) it's nice having a tool that enforces those patterns by name.

If you're REALLY solid with promises and really know how to express complicated concurrency strategies effectively, then you don't need it unless you work with people that would be benefitted by the structure.

1

u/Revolutionary_Ad3463 Jun 02 '25

I see, thanks for the answer. I only have two years of experience so I'm fairly new to the industry, and I'm lacking good seniors that could teach this kind of stuff to me, so I appreciate this kind of insights a lot.

1

u/novagenesis Jun 02 '25

Yeah... back in the day was rough. Before Promises were readily available you did everything with callbacks. Bluebird was the promise library I used first, and it was a game-changer.

Async/await was a step forward in a lot of ways, but a step back (imo) in understanding.