2

I've been using Nodejs and I really dislike callbacks (as i think most people do.) I'm starting to learn about promises and generators. Both are a lot cleaner and I'd like to forget the horrors of callbacks all together and erase them from my memory.

Is there any reason I need to use callbacks. Can I completely abandon them and use promises or generators instead of them and never need to write another callback? Or do they have some use case where they are needed?

Cyph
  • 121

1 Answers1

2

The short answer is yes, you can pretty much replace callbacks with promises. The caveat is some library APIs use callbacks so you are unlikely to be able to avoid them altogether.

takinola
  • 235