Hacker News new | ask | show | jobs
by shawndrost 5232 days ago

  In my experience, there's very much a need for a controller when writing even 
  moderately complex apps. You're presented with several options:

  1. Write controller code in views
  2. Write controller code in models
  3. Write controller code in a router
  4. Write your own controller infrastructure

  If you care about separation of concerns, none of these options are really 
  acceptable.
I care about separation of concerns when it's limiting the program complexity, and I don't have any problem with 3. Routing code is very lightweight, and it's sometimes beneficial to associate it with controller code -- those concerns are closely related, and not often referred to separately. In backbone, it's very easy to split a router into many (controller-style) files. If others have experiences to the contrary, I'd be interested to hear them.