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

Other, more striking callback issues are not mentioned #26

Open
PavelVanecek opened this issue Feb 18, 2016 · 1 comment
Open

Other, more striking callback issues are not mentioned #26

PavelVanecek opened this issue Feb 18, 2016 · 1 comment

Comments

@PavelVanecek
Copy link

Using callbacks comes with many issues and indentation with curly braces jungle is but one of them. By passing a callback you are passing the control over to a potentially buggy code with undesired behaviour.
The callback problems are:

  • callback can be called once, twice, infinitely many times, or never, and you have no control over it
  • callback can be called in synchronous or asynchronous fashion
  • callbacks swallow exceptions and force developers to conventions
  • callbacks make writing the curlybraced and indented code easy

I did not invent all of it myself, I learned a lot in YDKJS: https://github.com/getify/You-Dont-Know-JS/blob/master/async%20&%20performance/ch2.md

Yet the webpage only mentions the last one, from my point the least important one. Is it possible to at least mention that there are other, more serious problems, which actually turn this whole area into a real hell?

@ivan-novakov
Copy link

+1

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

No branches or pull requests

2 participants