Re:Learn AngularJS
by PopsiclePete on Friday April 03, 2015 @11:59AM
(#9316584)
Is there an actual reason to use AngularJS that's not just hype? It seems incredibly over-engineered to me, compared to something like React. I realize it's the newest, coolest thing, but...why?
[ Parent
| on HN ]
Re:Learn AngularJS
by sergiotapia on Friday April 03, 2015 @12:42PM
(#9316868)
I feel like I'm taking crazy pills, what does React do exactly - what does it replace? I read the landing page a couple of times and I don't quite understand what it's supposed to solve.
Re:Learn AngularJS
by PopsiclePete on Friday April 03, 2015 @01:42PM
(#9317245)
React allows you to build stateful javascript components in a nice manner. Think change propagation. You have a visual tree of a parent component and many child components. React makes it really nice, easy, and fast to propagate changes up and down your visual tree. Very MVVM-like, to me. You change some state, and React takes care of updating the appropriate visual components.
This is achieved with some custom syntax and also a fake/virtual DOM that you work with. The gain from all this is speed. It's impressively fast, in fact.
Um, React is currently the "newest, coolest thing"
From the official website of both technologies:
React: "A JavaScript library for building user interfaces"
AngularJS: "AngularJS is a structural framework for dynamic web apps".
So, aren't they two different things? (Honest question since I haven't play with React yet).
Yes, they are. React deals with more of the templating side of things (many people use it as the V in MVC, or in some cases as the V & C). But along with React, Facebook also released their Flux architecture which isn't a framework but a new approach to the MV* pattern which many people are using with React. Part of the Flux architecture is a concept called "Dispatcher" which handles the flow of data throughout the app. Facebook did release their code for their implementation of a Dispatcher but not much else. So React + Flux can act as a complete framework, but React alone does not.
The combination of React with a data/state management pattern such as Flux (https://facebook.github.io/flux/) is fairly analogous. You can also just use something like Backbone models (for example) with React if you want to use a more 'traditional' JS MVC pattern.
React even say themselves they're just the V in MVC. Angular is full stack. What you need and which is best is probably up to yourself to answer. I personally found it nice that angular is a working framework, instead of having to piece together a framework myself using react++
Re:Learn AngularJS
by WolfeReader on Friday April 03, 2015 @12:06PM
(#9316634)
AngularJS empowers your HTML. Done right, your JavaScript files are concerned only with retrieving/manipulating data, and your UI code fits snugly into your UI description.
Compared to managing the DOM in both your HTML and your JavaScript files, AngularJS seems so much better organized.
Too late to ask this question, actually. In 2011 this question could be valid, but not in 2015. Hype can't last so long.