Here's a code example from an npm package I was looking at, vs how I would rewrite it in modern JS: https://gist.github.com/scf4/8157abd755eb9c232e87dcc342b78b4... Some of it may be preference but a lot of it is objectively simpler to reason about. I don't understand why anyone would choose to make things unnecessarily complex.
Comments (110) 18 threads
Show all comments
Showing thread 13 of 18
I didn't see any async/await stuff though, is there a reason for that? I'd imagine it would make some code much easier to follow.
Why? Where does this mindset come from?
Do you really prefer callbacks or just use them because they were once necessary? Are they so good you'd use them for sync operations too?
Personally: that seems like a waste of time. I'd rather just do: Likewise I'd rather do:Here's a code example from an npm package I was looking at, vs how I would rewrite it in modern JS:
https://gist.github.com/scf4/8157abd755eb9c232e87dcc342b78b4...
Some of it may be preference but a lot of it is objectively simpler to reason about.
I don't understand why anyone would choose to make things unnecessarily complex.