Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you expect a lot of callback it makes more sense to design that functionality as an object rather than as a single function. That way you can spread callbacks over many functionality and still maintain modularity.


Not necessarily -- the issue is not so much code modularity as much as control-flow issues, which separating out functions (mandatory) doesn't necessarily help with (because of all the flags of what function should call what other function afterwards, etc.).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: