Hacker News new | ask | show | jobs
by hippich 4190 days ago
I specifically did not mention any names to not trigger flamewar. And mentioned Ember only in relation to the video.

For me personally it is Backbone (very minimal skeleton-like framework), view/binding library I like today (and can switch tomorrow) and routing I probably write myself for specific use case.

If this is too "low-level", next what I will check in "higher level" framework - as least "magic" as possible - i.e. explicit getters and setters with current state of Ecmascript, clear rules on how and when rendering happens, debuggable views (which often means views being compiled into JS.), being able to split large application in pieces which get loaded on demand without hacking/monkey-patching framework, being able to use jQuery if I want to, and not include it if I don't need it.

Sorry, no specific answer to your question, as I think it is problem specific, and even Angular can be used in some limited cases as it turned out.

1 comments

> debuggable views

One thing I've found while doing Android dev is that views should exist as an immutable collection of state (POJO in Java), and there should be some mechanism to inflate a view from that state. I'm not sure how Angular or Backbone deal with this, but that switch simplified the logic a great deal and made testing straightforward.

this is idea behind handlebars templating - ideally, no logic whatsoever and you just supply object with data to render. But in reality it gets more complicated than that and sometimes you need to debug templates too. Unfortunately, debugging angular templates is pretty much hell (mostly because of all the "magic").
The way Square's library Mortar handles it in Android is that you essentially have a Model-View Model-View-Presenter sort of situation, where your View Model is JUST your data, your View is JUST the view logic, and the Presenter takes care of knowing how to inflate/deflate the view. It's pretty clean if your design is clean but can get hairy easily if it isn't; that's a feature not a bug for me.