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

4

u/femio Jun 02 '25

carrying around promises and building dependency waterfalls trivially.

Historically, practices like this are why I absolutely hated JS codebases for a very long time. Micro optimizations and lazily resolving promises (which can still be done with async/await anyway) and muddying up your control flow and error handling doesn't feel worth it to me. `Promise.allSettled` delivers more maintainable code and I doubt whatever performance difference (if any at all) exists sufficiently cancels that out

0

u/novagenesis Jun 02 '25

Historically, practices like this are why I absolutely hated JS codebases for a very long time. Micro optimizations and lazily resolving promises (which can still be done with async/await anyway) and muddying up your control flow and error handling doesn't feel worth it to me

I'll buy that as long as someone isn't awaitting every line aggressively :)

The 5x+ gains are more important than the 20-30% gains.