Hacker News new | ask | show | jobs
by steven777400 3966 days ago
We use Knockout in our workplace. I particularly like it because it is lightweight (you can mix it with plain JS or jQuery) and because it doesn't involve writing HTML as a string in JS.

We write mostly internal apps and so performance/scaling are not usually on the radar, but ease of maintainability across a wide spectrum of developer skill levels is.

As for comparing to other frameworks, my biggest concern with some frameworks is the writing HTML templates as strings in JS. I've seen a lot of folks arguing that "it's different this time" and that writing string HTML in JS is OK, but it just is such a smell to me to write one language as a string in another.

1 comments

Have you started using the new components available in knockout?

http://knockoutjs.com/documentation/component-overview.html

As a knockout enthusiast I was excited to see that get developed.

Yes (and I like them too), but I don't put the template as text. Instead I use one JS and one HTML file per component, loaded with require.js.
Yeah I'd imagine most people don't use the template as text -- one of the best parts about knockout is it's natural (HTML) feeling templates.

What do you use for routing?

I've been dreaming up a framework that's actually knockout +/- routing +/- requirejs +/- model management...

I haven't done any client-side routing. Normally each page is either static HTML/JS or is served by ASP.NET MVC on the server side. Then APIs are used to load the models on the client side and perform interaction. In other words, we're not making any effort to move to "single page" applications.
Ah I get it -- knockout is even better for that kind of usecase