Hacker News new | past | comments | ask | show | jobs | submit login

>> If you put this logic in the controller, what happens when you want a separate API controller that does the same thing?

You refactor.

In my experience, anytime you're writing something for the sake of "possible code re-use", you're wasting time. Code should and does get refactored often. By adding levels of indirection from the outset, you add a barrier to refactoring and likely additional unnecessary code.

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