Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup code, get rid of antipatterns #21

Open
garretraziel opened this issue Sep 7, 2015 · 0 comments
Open

Cleanup code, get rid of antipatterns #21

garretraziel opened this issue Sep 7, 2015 · 0 comments

Comments

@garretraziel
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant