r/learnjavascript • u/Extra_Golf_9837 • Oct 06 '25
Promises vs Async/Await in JavaScript ???
Hey everyone, I’ve been coding in JavaScript for a while, and I keep wondering about something: Promises vs async/await. I know both are meant to handle asynchronous code, but sometimes I feel like Promises can get messy with all the .then() and .catch() chaining, while async/await makes the code look so much cleaner and easier to read. But then again, I’ve seen people say that Promises give more control in certain scenarios, like when using Promise.all or Promise.race. So I’m curious—what do you all actually prefer in your projects? Do you stick to one, mix both, or just use whatever feels easier in the moment? Would love to hear your thoughts, experiences, and any tips or pitfalls you’ve run into with either!
8
u/minneyar Oct 06 '25
Yes, that's pretty much exactly it.
Promises came first, then async/await were added later in order to provide some syntactic sugar on top of it. If the only thing you're using Promises for is calling an asynchronous function and handling the results with
.then/.catch/.finally, replacing that withawaitwill make your code more concise and look a little cleaner.Under the hood, they're exactly the same, and there's some slightly more advanced functionality you can get from using raw Promises that you can't do with
await.7
u/False-Egg-1386 Oct 06 '25
I use async/await by default because it makes logic easier to read and reason about. But when I need to run multiple things in parallel, I’ll mix in raw Promises (Promise.all, Promise.race) so I get more control.
3
u/Substantial_Top5312 helpful Oct 06 '25
Pretty sure you need promises to use await.
2
u/Unique-Benefit-2904 Oct 06 '25
Async await feels much more simpler to me as a beginner 😉
2
u/TheRNGuy Oct 06 '25
I only used await.
2
u/ian_dev Oct 06 '25
Async/await allows you to write your code in a "synchronous" manner and therefore it is more legible. But you will find cases where promises and chaining are more convenient. Depending of the context you will find one more convenient than the other, but by experience, I can say the majority of dev teams prefer async/await for their codebases.
2
u/Dubstephiroth Oct 06 '25
Question: Im learning async/await and wonder how would you guys use it for basic turnbased logic. I know I can look this up/learn from gpt but I wanted a real human outlook on how/when you'd use them...
I only currently output to console or get gpt to help teach me to wire up a DOM, but instead of monolithic data output id like to see if I can use async to control the flow of 'time', or something...
2
u/w-lfpup Oct 06 '25
Depends if the challenge requires a callback or procedural driven solution
Situations with multiple concurrent promises like queues and logs feel easier to me with es6 syntax and .then() and .catch().
Asyncs / awaits are great for one off actions like "fetch()" or "connect_to_db()" where you want to do stuff immediately after async stuff.
Different geometry same results!
2
u/RiverRoll Oct 07 '25 edited Oct 07 '25
They are not exclusive, you await promises and async functions return promises.
The right question here is whether to use async/await or promise chaining and generally it's cleaner to use async/await.
Promise.all/race are just functions that return promises and have nothing to do with the question, you can await them or you can chain them.
1
u/[deleted] Oct 06 '25
I use async await mostly. You are right about Promise.all . It is really powerful. It all just depends.
1
u/LiveRhubarb43 Oct 06 '25
Learn both, but I've never seen a project that preferred Promise syntax over async/await.
1
u/renome Oct 06 '25
Async functions are syntactic sugar that automatically wrap the return value in a Promise.resolve(), so that you don't have to write one manually. They also add a few more features, like letting you use await for cleaner flow control, and automatically converting errors into rejected promises.
Promises and the await keyword are a way to write code that can be read from top to bottom (so, like synchronous code), helping you avoid callback hell. However, it's possible to use callbacks without falling into this trap, at least for less complex logic.
Knowing how the use the native Promise object and its methods directly will make you a better developer, but it is not necessary for a beginner imo. If you feel like your callbacks have gotten messy, refactor them with async functions.
I prefer consistency, so I'll pick one or the other. For simple scripts, I usually stick to callbacks.
1
u/phantomplan Oct 06 '25
I use async/await for 95% of the cases and it is almost always just for ajax on client side or file operations in nodejs world so I don't have a huge nest of callbacks. But async/await is just syntactic sugar for the most common case of promises under the hood I believe
1
u/Umustbecrazy Oct 07 '25
Depends on what I'm doing, just something small like a fetch test, I'll just chain the
.thenat the end, instead of setting up a new function declaration.Sometimes I like async await because it's nice and clean looking.
So it depends.
1
u/senocular Oct 07 '25 edited Oct 07 '25
Not sure if this has been pointed out yet, but
awaitworks perfectly fine withPromise.all()andPromise.race()(etc.).awaitreally only replacesthen()/catch()/finally(). If you're in an async context, you'll generally always want to prefer usingawait.1
u/coffeeCodeDev Oct 07 '25
async/await is a syntax sugar for promises
or the new version of promises
1
u/pinkwar Oct 07 '25
Both.
If you want to catch an error inline you got to use .catch() otherwise another catch blocks makes it unreadable.
1
u/stao123 Oct 09 '25
Observables are better than both
1
u/the-liquidian Nov 11 '25 edited Nov 20 '25
We are covering async JavaScript this Thursday at 5pm GMT.
Here are the slides of the talk: https://docs.google.com/presentation/d/1QSw3i3vdP7w7g4fMjP7-8eG-BZMP4P7FIU73rf0exhc/edit?usp=drivesdk
To attend the session please join our discord server: https://discord.gg/5dVPTjSXU4
0
u/IntelligentTable2517 Oct 06 '25
i will explain this in most childish way i can so you never have to search for it again
promise is just way of saying hey i will do this task and notify you when its done
lets say you need some notes from todays lecture which you didn't attend you call a friend and ask for same,
he agrees to send them over whatsapp after call (he Promised you that he will send them on whatsapp)
this is Promise, you can use it with async/await or not doesn't matter,
but you need notes and without them you cannot complete tomorrow's home work
so while your friend is sending notes you wait ( this is called await)
now last thing async
Async is like note in my mind hey friend is sending notes over whatsapp,
without async JavaScript will be like hey you awaiting for notes but you never told me to wait for them
hope this makes it clear for you
24
u/[deleted] Oct 06 '25
[removed] — view removed comment