Hacker News new | ask | show | jobs
by pault 5174 days ago
This is fine for small, one-person projects, but if you generate DOM content in your JS views it will come back to bite you in the ass once you hit a certain size. The first time you need to bring in a designer, or integrate a static mockup from a designer, you'll be wishing you used a template engine.

You wouldn't embed database queries into your view controllers, so why would you couple your html to your javascript?

2 comments

Thanks for the tip, but I've had much success using this method on teams of 5+ developers and a full-time designer.
Obviously you should do whatever works for your team, and I'm not commenting on the quality or necessity of your framework. In my opinion, it's just much easier to edit well formatted markup, verbose as it may be, than wading through a forest of $el and appendTo and such. Not to mention, hiring a talented visual designer that knows html & css is much easier than finding one that knows their way around a client-side MVC framework. Unicorns and all that. To each his own.
Because database queries and views belong to different logical layers whilst JavaScript and HTML are just different technologies that may be used for things on the same logical layer.

But I think your point about designers is a valid one for many projects.