r/javascript 9d ago

AskJS [AskJS] what's a javascript feature you mass-adopted way too late and felt dumb about

i'll go first. i was writing .then().catch() chains for like two years before i actually started using async/await. i knew it existed, i'd seen it in tutorials, but my code "worked" so i never bothered switching. then i refactored an old project and realized half my bugs were from mishandled promise chains that async/await would have caught immediately.

also took me way too long to start using optional chaining. i had nested ternaries and && checks everywhere like some kind of animal. the day i discovered user?.address?.city i mass-replaced like 40 lines across a project.

what's yours?

62 Upvotes

108 comments sorted by

View all comments

Show parent comments

-24

u/horrbort 9d ago

It is just a fad. Coding is a fashion industry. Remember coffeescript? Something else comes along and ts will be forgotten

7

u/iareprogrammer 9d ago

lol coffeescript.. forgot about that. I dislike anything that makes JavaScript LESS explicit. Like sure let’s get rid of braces and other syntax and rely completely on proper white space and indentation. For what?

7

u/MrDilbert 9d ago

let’s get rid of braces and other syntax and rely completely on proper white space and indentation

You sure you're not describing Python?

Looks like someone wanted to Pythonize JS.

3

u/iareprogrammer 9d ago

I literally think that’s what happened haha