I jumped on the React bandwagon like most of you but am always trying to solve Northwind Traders problems w/fewer SLOC, my favorite (but not only) metric for a 3GL.
The official MDG tutorials page include Blaze, Angular & React. Angular has fewer lines of code head to head w/React. Assuming each offers the same level of functionality, it would seem Angular wins in brevity and readability.
In this version of meteor, and w/the focus on ES6, why is React so much more popular than Angular? Is the ToDo sample not deep enough, not complex enough and/or the wrong problem to showcase either framework? What would be a better sample problem?
On the community front, React is twice as large on every Meteor metric (# of github watchers & forks, # of posts here) and it also has a compelling mobile story. Is it all about Facebook vs. Google’s vision for the web? Is Blaze the Walking Dead? What else should be considered in choosing a framework?
Hope this helps.
Also, we should all learn Angular and React as neither is going away and it makes you a better developer. For that matter, we should just embrace ES2015 and just use Angular or React where the spec requires such. Do some Blaze projects too!
I’m not on the fence w/React and have used it successfully. I just wonder if that’s the right choice, especially after taking another look at Angular. If we need to add H3PO4 (phosphoric acid) to soft drinks because there’s too much sugar to prevent the “vomit reaction” (or in this case too much blending of concerns), perhaps that’s a signal that something is wrong?
Is DOM manipulation (and render speed) the best metric? Perhaps the diff between the two really shines on a larger project or one that focuses on render time?
The reason I favor # of lines of code is a lower developer effort, maintenance and likelihood to introduce bugs.
I disagree with this a lot. Less lines of code leads to more confusion, and more bugs not less.
The only thing that matters with your code in terms of lower dev effort, maintenance, and bugs is simply code readability.
One of the simplest things to do in terms of less lines of code is often to turn an if statement into the ternary operator, but if you apply that to a bunch of nested if statements, then that quickly becomes impossible to read.
With React, you create dozens of components and bring them together, which makes it super readable.
This is a fake app I just made up but it’s super easy to see what each piece does. If Angular has something similar and is just as easily readable, then yeah I won’t argue against using it, but the last time I used Angular, there was nothing like this at all, which is why I opted for React instead
It’s called directives and it’s been in angular since day 1.
In angular 1.5 and angular 2 they also are named components, but it’s the same thing.
You could actually make it exactly the same, except you can’t use self-closing tags in angular 1, so you’d get:
It’s a false dilemma to assume there is only 2 ways to write code (w/ternary operators on a single line vs. if splayed out). There can be combinations of both that affect readability. Moreover, this is off-topic and has nothing to do w/Angular vs. React (both can use either format); if you are saying that JSX is better because it has more LOC and is therefore more readable, I’m not buying it.
I was quoting you, @nolapete who brought up “blending of concerns” (scroll up). I also watched the video you recommended (the relevant part starts at 3:05 in this link). Pete, though informative, does not address this discussion; we aren’t arguing React vs. No React (which is what Pete’s presentation addresses).
The choice between Angular 2 and React comes down to a style preference. React, as a library focused on speed of rendering, is a useful tool for handling large and complex UI presentations in your client or native applications. Angular 2, on the other hand, takes a much broader view of the development process. As an opinionated framework, it’s looking to guide the way in which you build your apps, while also allowing you to create expressive and reusable UI experiences.
Ultimately, the decision will vary based upon the goals of your application, as well as the opinions of your development team. If you favor performance of large complex user interfaces, React is a good choice, while if you want to focus on enhancing the development process and your code’s architecture, Angular 2 will be the right way to go. As always, by understanding your problem space and the needs and desires of your development team, you ultimately won’t be able to make a wrong decision.
[quote=“areich, post:3, topic:22970, full:true”]
If we need to add H3PO4 (phosphoric acid) to soft drinks because there’s too much sugar to prevent the “vomit reaction” (or in this case too much blending of concerns), perhaps that’s a signal that something is wrong?[/quote]
The phosporic acid is used as a conservant and to give soda a “sharper” taste. Not sure where you got the “too much sugar” stuff from.
10 teaspoons of sugar hit your system. (100% of your recommended daily intake). You don’t immediately vomit from the overwhelming sweetness because phosphoric acid cuts the flavor allowing you to keep it down.
Also, I was using it as a comparison for the discussion regarding Angular vs. React and wasn’t trying to start a meta-discussion on sweeteners in soft drinks.
I’m not vouching for Fanta or Sprite and was just sharing the info graphic that was the basis of my comparison.
If you are saying to not use analogies because people may want to discuss that instead of the topic (Angular vs. React), I’d say that it’s well worth the risk (also it’s nonsensical to limit speech because people might get confused by it).
Maybe so but if you use such analogies, be absolutely certain they are correct.
I stumbled across that because I’m a chemistry teacher and in addition to covering carbohydrates, we also discuss nutrition. Ten spoonful of sugar are not that much and as such, constitutes an extraordinary claim - which, as we all know, need extraordinary proof Not to mention that there are quite a number of dubious claims when it comes to soda.
Since we are already far-afield, I might as well address you (for posterity ).
Agreed, I should have explicitly stated Coke and not all soft drinks.
Ten spoonfuls of sugar is an extraordinary amount (perhaps not for the SAD though), assuming the spoon is for tea and not for the table (which would equate to an even larger dose). According to WHO, the recommended daily intake of sugar for an adult is 6 teaspoons or 25 grams. In a western diet where sugar is in bread, dressings, sauces and as an additive to pretty much everything, limiting to 6 teaspoons is difficult if not impossible.
Yes, the dose is large. Then again, I’ve seen people wolf down a whole 500 ml cup of Ben&Jerries or Häagen-Dazs which pretty much undoubtedly is even more sugar. No vomit reactions there.
Also, again, doesn’t explain why other Sodas with the same or even larger amounts of sugar don’t have phosphoric acid. Sorry, but your “source” does not make sense - then again, it’s something completely without any kind of references which is always a very bad sign. It’s kind of the reason Snopes exists.