9 ms·
I'm curious what Angular 2 is like for developers who normally write React? I hear 2 is a lot better than 1, but I'm still turned off by the amount of Angular-s
by morley 11y ago
I'm curious what Angular 2 is like for developers who normally write React? I hear 2 is a lot better than 1, but I'm still turned off by the amount of Angular-specific terminology, whereas most of React terminology is not necessarily React-specific.
- merpnderp 11y agoWe use Angular 1.4 at work, but your reasons are exactly why I'd prefer React. It is mostly just Javascript without a lot of Angular specific conventions. At least Angular 2 looks nearly as good as React and work is planning on upgrading.
- erokar 11y agoMe too. Impression, admittedly only from reading about it and looking at a few code samples, is that Angular 2 is over engineered and complected, as is 1.x, which I have worked in daily for over a year. ReactJs is much more appealing these days.
- clessg 11y agoI've used and followed Angular 2 somewhat over the past year. My take is that React is better for engineers familiar with JavaScript, while Angular may be more comfortable for engineers with a preference for Java/C#. I don't mean that in a bad way; it's simply been my experience that people coming from those languages love what they see of Angular 2, and are repelled by React. It's not hard to see why. This code[0] from Angular 2 would just be a function in React: @Pipe({ name: 'tempConvert' }) // The work of the pipe is handled in the tranform method with our pipe's class class TempConvertPipe implements PipeTransform { transform(value: number, args: any[]) { if(value && !isNaN(value) && args[0] === 'celsius') { var temp = (value - 32) * 5/9; var places = args[1]; return temp.toFixed(places) + ' C'; } return; } } There's also the fact that Angular is a framework, whereas React is a library. Those of us in JS land typically (but not always) prefer smaller libraries. [0] https://auth0.com/blog/2015/09/03/angular2-series-working-with-pipes/ https://auth0.com/blog/2015/09/03/angular2-series-working-wi...
- Matthias247 11y agolet's be fair, Pipes can do a little bit more then pure functions. E.g. the async pipe which lets someone directly use Observables in the view is really helpful. And a simple function in combination with Observable.map() or Promise.then() won't bringt that functionality to React (you need to write lifecycle hooks or mixins, and in the end it would look similar to your construct.
- EGreg 11y agoI wonder what you guys would think of this: http://qbix.com/platform http://qbix.com/platform It was built with concepts from Angular 1 and React in mind. But it doesn't use either. Especially this: http://qbix.com/platform/guide/tools#dom http://qbix.com/platform/guide/tools#dom Here is an example app built on it: https://github.com/EGreg/Overlay/blob/master/web/js/Overlay.js https://github.com/EGreg/Overlay/blob/master/web/js/Overlay....
- dustingetz 11y agoLets see what happens to react. I hear React is building in support for Relay, React Native, other facebook stuff. I <3 <3 <3 react, they have done an amazing job so far, as a React.js consultant and early adopter I owe my financial well-being to React, but big projects from big companies have weird incentives, Conway law, everything made by big companies inevitably goes to shit, yada yada. Maybe Relay ends up being not the best solution to the client/server query composition problem (IMO its not). Maybe people will get burned by 50-shades-of-flux (IMO the Great Flux Wars have barely started) and for the type of company that writes a ton of javascript, the framework pattern will come in vogue again (IMO). Maybe there will be an explosive patent lawsuit where Facebook decides to weaponize its "defensive" patents for whatever reason. I personally believe all of the things in this paragraph will happen in the near term. Edit; Sorry i meant Conway's Law https://en.wikipedia.org/wiki/Conway%27s_law https://en.wikipedia.org/wiki/Conway%27s_law
- such_a_casual 11y agoIsn't Godwin's law that any online discussion will eventually lead to someone comparing something or someone to Nazi Germany if given enough time?
- archimedespi 11y agoYes, it is; I'm not sure what comparison 'dustingetz was trying to make.
- manachar 11y agoYes, that's Godwin's. Not sure which "law" the original intended, but may be an example of Cunningham's Law. [1] https://meta.wikimedia.org/wiki/Cunningham%27s_Law https://meta.wikimedia.org/wiki/Cunningham%27s_Law
- lewisl9029 11y agoIn my mind at least, the so called Great Flux Wars have already been won by Redux. I just finished my first non-trivial app built with Redux + ImmutableJS a few days ago, and it was pure bliss. Finally, we're able to build entire applications as a mapping of pure state transitions on top of immutable data in JS. Redux is by far the biggest reason why I haven't yet completely abandoned JS for ClojureScript.
- um_ya 11y agoNever understood why people liked React so much. I don't know why, but mixing javascript and HTML just looks... gross.
- gelatocar 11y agoYou don't have to use JSX.
- um_ya 11y agoThen what do you use?
- burnninator 11y agoWe write our react components using coffeescript, it actually works pretty well.
- pascalo 11y agoJust build the dom in JS, like so: React.createElement( string/ReactClass type, [object props], [children ...] )
- rjayatilleka 11y agoI haven't used React in a while, so maybe this has changed, but can't you just do something like component = React.createFactory(MyReactComponentClass); component(props, children);
- nailer 11y agoReact providing a mustache-like format (like ractive.js uses) would be great - more familiar than JSX and less clumsy than createElement(). Edit response to person below (rate limit): there's no 'problem', just that mustache is still more familiar. Moving JSX into a different file doesn't change that.
- 11y ago
- EugeneOZ 11y agoOne of core Angular 2 things is ReactiveX :) https://github.com/ReactiveX/RxJS https://github.com/ReactiveX/RxJS
- joelhooks 11y agoI've spent a lot of time with Angular 2 (alpha)[0] and React (redux flavored). All in all it is fairly similar, and feels pretty good. You have to remember more syntax, because of the configuration, but it isn't as conceptually difficult as Angular 1.x The templating syntax is "weird", and it definitely adds to the list of things you have to know specific to Angular 2. React and JSX is nice because logic is just JS, and not special template syntax (directives). I'd be happy to build an app with Angular 2 or React for different reasons. What's hard is looking at Angular 1 now. [0] I've given multiple Angular 2 workshops, built large scale Angular 1 apps, and build React components daily for my business (a popular web developer video tutorial site).