3 ms·
Although it's nice to express things concisely, we don't think size in raw lines of code is the most important metric in the code. Generally we are interested
by danabramov 10y ago
Although it's nice to express things concisely, we don't think size in raw lines of code is the most important metric in the code.
Generally we are interested in solutions that allow us to iterate quickly, and to ship less buggy apps, and React has been helping out with this.
I don't have experience with Vue, but I also heard great things about it, so I'm glad there are many alternatives if React doesn't work well for you!
- beefman 10y ago> we don't think size in raw lines of code is the most important metric in the code I've read this claim from FB before (Pete Hunt I think). It's not possible to overstate my disagreement. I guess if you want to say, 'people in general can't program, but they can plumb things together, and once they learn the conventions the boilerplate becomes transparent', I wouldn't argue. But you haven't said it, and it's not a direction I think is so great for software. In the future we want one-line applications, right? "Siri, create a calendar app with conflict resolution for the local Owl's club." Not four pages of "Siri, open angle-bracket props colon..."[1] Re. Vue, I'm sorry I mentioned it. I don't have a horse in the race. However if I did I would definitely have taken the time to try Vue by now. And likewise Guarini, if this is really his first time trying React, has not done basic due diligence by waiting this long. We can't improve as a field unless we compare results. That TodoMVC is the only benchmark that even exists is unfortunate. [1] For some evidence in the meantime see http://blog.vivekhaldar.com/post/10669678292/size-is-the-best-predictor-of-code-quality http://blog.vivekhaldar.com/post/10669678292/size-is-the-bes...
- acemarke 10y agoI think the point is that LOC is a bad metric in general. In the same way that you wouldn't want to measure a dev's output by LOC/day, just comparing LOC for a small task isn't really meaningful. That approach can be heavily gamed (see code golfing), and there's the apples/oranges aspect as well. jQuery is meant for manipulating arbitrary DOM nodes in a page. Assuming they share a classname, I can hide a dozen divs scattered throughout the page with a single `$(".myClass").hide()`. In React, I'd probably need to pass some state through several components, and ultimately re-render, which would be considerably more LOC. Does that mean that React is "worse"? No. It means they're meant for different kinds of tasks. React is meant for making codebases maintainable and understandable. Sure, fewer LOC is _usually_ a good thing, but many times being more explicit makes a codebase more maintainable.