Hey everyone, I'm Raz, I'm a Software Engineer and HCI enthusiast. I've been working professionally since ~2013, now full remote. Also hacking on my main side project, Chartbrew.com in my free time.
I agree with this completely. I tried refactoring my code to async/await because it was the new thing, but I ended up sticking with promises because the code was much cleaner
Nicky's been a maker since his grandma bought him his first *real* toolbox when he was 4. His aunt taught him JavaScript when he was 12 and almost 20 years later, he still can't stop programming.
Curious web developer interested in tech, dogs, & good food! Believer in all things magical and lover of people! Work with some of the most amazing people and customers @ Cloudinary!
Cool, and there are definitely valid use cases for this, but I am scared the people who are too enthusiastic about async/await will abuse this and the amount of PRs that change
VP of DevRel RapidAPI β― Award-winning Web Developer NodeCLI.com β― Google Dev Expert Web tech β― 2x GitHub Stars Award β― WordPress Core Dev β― TEDx Speaker β― "awesome example for devs" β Satya Nadella
Location
San Francisco Bay Area
Education
EE-CS Engineer turned Software Developer
Work
VP of DevRel (DX Eng., Content & Community) RapidAPI β― Google Dev Expert β― GitHub Star β― NodeCLI.com
// Unrelated
I've read a lot of good things about axios, but never from a DEV community member yet. I wish to read one soon! Especially why fetch is better than axios instead of why axios is better than fetch like what most articles I've read says so.
We have to be careful and understand how async/await works. The converted code doesn't behave exactly the same in the twitter example. Before conversion the function returns a promise that resolves with undefined, and console.log(err) is called. After conversion, the function returns a promise that rejects, and console.log(err) is not called. We would assume the converted code should behave the same; thus it's a bug IMO.
async/awaitsometimes looks less readable thanpromise.thencounter-part.So one can use it when async/await version makes it more readable π.
I agree with this completely. I tried refactoring my code to
async/awaitbecause it was the new thing, but I ended up sticking with promises because the code was much cleanerIt's very useful when you have if's especially if you have conditional diamond forks.
Yes, agreed.
I completely agree .. I can orchestrate the chains of thens in a Promise however it makes it more readable for me
Few releases later VSCode will learn how to make coffee β
If I recall correctly, the changelog also mentioned this was thanks to a summer intern on the VSCode team. Pretty cool!
That's a really cool aspect of this, go summer intern!
Wow, thatβs fantastic!
Cool, and there are definitely valid use cases for this, but I am scared the people who are too enthusiastic about
async/awaitwill abuse this and the amount of PRs that changeinto
Why would it leave a then hanging off of an async call?
Which one are you talking about?
You mean the abuser would write the following?
VSCode is awesome! π
Credit: @umaar , of course.
Hey Ben, I'd be down for an AMA as @nickytonline suggested (thanks Nick for the kind words about the course ποΈ)
Sounds good to me π
You should ask @umaar if he'd be up for an AMA. He's a dev tools guru. I signed up for his moderndevtools.com last year and it'sπ₯π―
// Unrelated
I've read a lot of good things about axios, but never from a DEV community member yet. I wish to read one soon! Especially why fetch is better than axios instead of why axios is better than fetch like what most articles I've read says so.
We have to be careful and understand how async/await works. The converted code doesn't behave exactly the same in the twitter example. Before conversion the function returns a promise that resolves with undefined, and console.log(err) is called. After conversion, the function returns a promise that rejects, and console.log(err) is not called. We would assume the converted code should behave the same; thus it's a bug IMO.
Wow amazing
Watchout I saw some bugs reported on this feature, like all refactorings keep an eye on it and add more tests π
Beautiful.
I was thinking more about writing new code than updating old code. Thatβs a very strong use case!