DEV Community

Discussion on: What is your opinion on callbacks in JavaScript?

Collapse
 
tobiassn profile image
Tobias SN

They often are that way for backwards compatibility, or simply because they haven’t been updated yet.

Collapse
 
farenheith profile image
Thiago Santos • Edited

Yeah, I agree.

Also, promises are always more preferable. Sync functions should be avoided in most cases, specially in browser js. When I'm programming in node, sometimes I use fs sync functions for the sake of simplicity, when I'm writing a cli code or the initialization of a server. Never in code that'll run concurrently.