tastejs / todomvc

Helping you select an MV* framework - Todo apps for React.js, Ember.js, Angular, and many more
http://todomvc.com
Other
28.56k stars 13.79k forks source link

Non-framework jQuery implementation #1475

Open dmitrymar opened 8 years ago

dmitrymar commented 8 years ago

I have noticed that your Vanilla JS implementation follows MVC pattern by having separate components ( controller.js, model.js, etc. ). Is there a reason why your jQuery implementation doesn't follow similar pattern and is made up of only app.js?

LoveAndHappiness commented 8 years ago

I also like to point out that Vue also doesn't adhere to any code separation architecture.

Compared to Polymer, which tries to follow some MVC-architecture and uses an attachedCallback on the view (´td-todos´) to reference the properties and methods on the model (´td-model´).

In my understanding, this seems unnecessary for Polymer and was only done to adapt to the MVC architecture.

As a consequence we have semi-redundant methods in Polymer, one calling another in different files (´addTodoAction´ and ´newItem´). Compared to Vue's unbeatable 124 lines of code.

And I was wondering, why Polymer is making things comparably more complicated, only to understand that Vue just hadn't applied any separation of code, which makes sense, because Vue is an MVVM layer.

Though Polymer isn't a framework either. Quite confusing to compare these two from the default point of view.

dmethvin commented 8 years ago

I'll also note that knockoutjs doesn't separate these, it's all in one app.js. If the examples are supposed to follow some rule about file-based separation of models, views, and controllers then the docs should mention it. It's definitely overkill for something of this size so I'm inclined to say a single file is fine, but I understand that architectures designed for dozens of Ms, Vs and Cs may have conventions that put them in separate files.