3 ms·
Yeah, depends what you value. vue is "easier" with probably less boilerplate at the cost of more magic and less type safety due to magic string templates (if u
by boubiyeah 9y ago
Yeah, depends what you value.
vue is "easier" with probably less boilerplate at the cost of more magic and less type safety due to magic string templates (if using typescript like I love to)
Definitely not a good tradeoff for me, but it is for some.
- k__ 9y agoNever understood this. How is Vue easier if we only consider components? How can it offer something simpler than functions as components?
- vec 9y agoBecause "simple" and "easy" are not synonyms. For example, Backbone is much simpler than React. React keeps a full virtual copy of the DOM in runtime and uses complex diffing algorithms to decide when and how to actually update the DOM in a manner which is entirely opaque to the developer. Backbone just does the DOM updates you tell it to, when and how you tell it to. And since Backbone is so much simpler, it logically follows that building an application in Backbone much be much easier than building the same application in React, right? Right? In Vue, a component generally consists of a raw JS object, an (almost) HTML template, and a block of raw CSS. The framework does some opaque but straighforward work to bind these three together into a single conceptual entity. This is indeed more complex, but the added complexity follows the grain of my preexisting intuitions. The end result, in practice, is components which have a clean internal structure and much less boilerplate. Slightly more complex, but easier.