You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While we are using async, there is still a lot of antipatterns - callback hell (everywhere), not-error-first callbacks (mainly memdb) etc.
Quite often, there is unnecessary anonymous function - when function a could take function b as a callback, but instead there is an anonymous function that only calls b in its body. Promises could be also used.
Another thing is that there is often not clear where logging should take place. I think that the best way is to propagate all err objects to topmost function and log them using winston only after they aren't passed further.
The text was updated successfully, but these errors were encountered:
While we are using
async
, there is still a lot of antipatterns - callback hell (everywhere), not-error-first callbacks (mainly memdb) etc.Quite often, there is unnecessary anonymous function - when function
a
could take functionb
as a callback, but instead there is an anonymous function that only callsb
in its body. Promises could be also used.Another thing is that there is often not clear where logging should take place. I think that the best way is to propagate all
err
objects to topmost function and log them usingwinston
only after they aren't passed further.The text was updated successfully, but these errors were encountered: