T
1

Hot take: I learned JavaScript async/await way too late

Honestly, I spent like 2 years using callback functions for everything. I had this mess of nested functions that looked like a staircase from hell. About 6 months ago, I was building a simple weather app for a friend and got buried in 50 lines of callback spaghetti. So I finally sat down and learned async/await in a single afternoon. It cut my code from 50 lines down to maybe 15, and it's way easier to read. Now I can't believe I ever wrote code the old way. Has anyone else stuck with an old habit way longer than they should have?
2 comments

Log in to join the discussion

Log In
2 Comments
ivan82
ivan821mo ago
Realized the same thing when I switched from driving stick shift to automatic after ten years. Spent those years thinking I was better because I could "control" the car, but really I was just making my commute harder for no reason. It's funny how we cling to the old way of doing things even when a simpler option is staring us in the face. Same deal with using cash instead of a debit card, or writing lists on paper when your phone can do it faster. We get stuck in a rut and don't realize the shortcut is right there until we're forced to try it.
3
iris_ellis
iris_ellis1mo ago
Wait, you drove stick for ten years thinking you were somehow more in control? That's wild to me. I mean, I get the appeal of feeling like you're really "driving" the car, but ten years is a serious commitment to a harder way of life. I tried stick once and stalled out at a stoplight on a hill and that was enough for me to nope right back to automatic. Did you actually enjoy it the whole time or was it just stubbornness keeping you there?
3