Git Product home page Git Product logo

Comments (19)

jeffwhelpley avatar jeffwhelpley commented on May 24, 2024 2

I made fun of Kent for posting this, but I understand his reasoning. For the most part, he is right. Today if you were starting a new project, React is the best framework. However, one big difference between Kent and I is that I as soon as Angular 2 is closer to full release (i.e. guessing ~April 2016) I will use Angular 2 for every nearly every new project. That doesn't mean Angular 2 will be definitively "better". It's more like leveling the playing field and the choice between the two will end up being one much more of personal taste and specific project requirements (assuming the performance characteristics and features will be nearly the same which it appears will be true).

You will be able to code Angular 2 in a "React-like" way just like you can code React in a "Angular 2-like" way. In fact, many of the Angular 2 libraries won't be tightly coupled to Angular 2 so you could use them easily with React. My point here is that while you almost certainly see all sorts of comparison articles in the future the reality is that nearly anything you can do in React you will be able to do in Angular 2 and vice-versa. The true differences between the frameworks will largely be under the hood (rendering engine, change detection vs DOM diffing, etc.).

However, the reality is that most people will code React and Angular 2 in their respective "idiomatic" formats. There obviously is no such thing as idiomatic Angular 2 yet, but I think the difference will look like:

  • React - Immutable.js, functional programming, flux/redux, relay/graphQL, Babel
  • Angular 2 - RxJS, classes, TypeScript, decorators, dependency injection

Again, you can make Angular 2 look like React and vice-versa, but this is what I think most projects in each will probably end up looking like. So, the stuff typically associated with React is likely going to appeal more to devs that have their foundation in functional programming languages while Angular 2 is likely going to appeal to more to devs that have their foundation in OOP-based languages like Java and .NET.

(edit: Kent locked this thread so adding just one more thing to illustrate my point)

It is kind of fun to think of the extremes here:

React acting like "Angular 2"

Angular 2 acting like "React"

from ama.

benoror avatar benoror commented on May 24, 2024

+1

from ama.

kentcdodds avatar kentcdodds commented on May 24, 2024

Let me preface this with the fact that I work with Angular all day at work. I have several open source libraries for Angular, I host AngularAir, I'm an egghead.io author where most of my lessons are Angular related, and I've given many talks that are Angular related.

On the other side of the fence, I've spent some time with React, built a library (and another loosely related one), given some talks, and even created an egghead.io lesson.

If I were to start a new project today, would I use Angular or React... It really depends on the project.

I'm pretty darn productive in Angular. If I need create something quickly, I'll definitely use Angular. I'm more comfortable in Angular, I know it really well.

If I have time to learn something new, I'd probably use React. I love what React is doing. I love that Angular 2 is adopting some of the concepts. I think React is totally solid.

Here's the real kicker: If I had the freedom and leisure to build a major product from ground zero (like if I were to do a startup or something), I would probably go with React. Seriously. I think some people in the Angular community are going to come at me with pitchforks right now. But as much as I like Angular 1, I think React is better. Will Angular 2 be better than React? I think it might, but that remains to be seen. But it's the principles and concepts behind React that I really like.

So there you go :-) Thanks for the question!

from ama.

tylermcginnis avatar tylermcginnis commented on May 24, 2024

Great answer.

from ama.

jsteenkamp avatar jsteenkamp commented on May 24, 2024

A long time angular user but I'd agree and go React.

The way I look at it is that you can use React today. There is already a wealth of experience and projects around React. There is a lot of innovation like Relay (GraphQL), Redux etc. It solves other problems like CSS encapsulation, universal/isomorphic rendering... There is an impressive mobile solution with ReactNative. Big companies are using it in production.

Angular 2 is a work in progress. Angular 2 is adopting learnings from React which is great but it must impact development as plans have changed. I'm not convinced TypeScript (yes I know it's optional) is the way to go. I would not bet on using Angular 2 in production until 2016. Then it will still take time to build/develop the depth of experience comparable with React.

from ama.

kentcdodds avatar kentcdodds commented on May 24, 2024

+1 to everything you said @jsteenkamp

from ama.

kentcdodds avatar kentcdodds commented on May 24, 2024

Seems legit @jeffwhelpley, thanks for contributing to the conversation πŸ‘

from ama.

robwormald avatar robwormald commented on May 24, 2024

To expand a bit on @jeffwhelpley's answer - angular2 is at it's absolute best when using the same sort of paradigms that React encourages (that is, one way data flow).

You can basically use Angular2 in one of three ways:

  1. the way you use angular1 today - where mutability and two way data binding are the norm. This still works, and angular2 rethinks some of the under-the-hood stuff to eliminate some of the issues with two-way data binding. That said, I'd encourage all devs to look beyond this sort of thing, regardless of the framework you use.

  2. immutable style - which has a major performance boost as checking reference equality is muuuuch faster - this is closer to how React does things, and Flux/Redux and the like play nicely with ng2.

  3. observable/reactive style - this is my personal favorite right now, and I think is how the "next-gen" of how JS stuff will work. In this model, your data notifies the framework it's changed, and in angular2 you can actually disable dirty detection in this scenario - angular will simply skip checking components until your data notifies it that something has changed.

Personally, I think using React today, and un-learning a lot of the "bad" (read: data mutation) behaviors from NG1 is a great idea. Learning to think in one-way data flow, avoiding mutation, embracing immutability, etc, all of these things will serve you well in the future, regardless of the UI framework you choose. It just happens that when Angular2 is ready, you won't have to throw out that knowledge - it'll apply equally well to angular2 development.

from ama.

kentcdodds avatar kentcdodds commented on May 24, 2024

Love both of your additions. Thanks guys!

from ama.

jsteenkamp avatar jsteenkamp commented on May 24, 2024

Actually David Nolen (@swannodette) showed the way (well one way) at end 2013 and I did not get it: "Finally, because we always have the entire state of the UI in a single piece of data, we can trivially serialize all of the important app state - we don't need to bother with serialization protocols, or making sure that everyone implements them correctly." The Future of JavaScript MVC Frameworks

Innovative stuff is happening in places like Elm, CycleJS and many others.

from ama.

kentcdodds avatar kentcdodds commented on May 24, 2024

Agreed. Been meaning to give both of those a look actually :-) So much to learn!

from ama.

marcusradell avatar marcusradell commented on May 24, 2024

Angular 1.2 saved my life! My first web app had a pretty straight forward design with ng-controller inherited scopes. I loved it!

Then I listened to some podcasts, and started to up my game with browserify and gulp. But the community was fading. I worked for a large telephone service provider that did everything wrong. ng-init, inherited scopes, leaky event listeners. I tried to convince them to do more component based directives and isolate the scopes. But they didn't get it.

My biggest issue with angular 1 is the learning curve. It starts really low, then you get pretty good. Then you hit a brick wall and need to learn MVVM, why you need to make an angular.module('app').factory('myDirectiveFactory'), why the DDO is really an MVC controller and the controller/scope is a viewModel.

I'm too new at React, but I see the same thing here. I'm trying to use React with RxJS and Immutable. I still have no clue what kind of data store solution I'm going with until Falcor gets production ready. I tried director as the router, but had some basic issues with it and will now try out React Router. Good things doesn't come that easy, I guess.

On the question of Angular vs React, I would choose the tool that solves most of my problems.
I want to be able to:

  • Create a new component on the go while the designer gives me border colors and font sizes. (Live Reload. And Isolated code.)
  • Read and understand the code. (Isolated code.)
    *Update to without visiting 5 different files. (Browserify/Webpack + dynamic names set by folder name. Oh, and isolated code.)
  • Delete an old, unused component. (Isolated code.)

tldr; Check out what Netflix does and copy them ;-)

from ama.

alvipeo avatar alvipeo commented on May 24, 2024

Here's the exact situation I'm in right now. And I've spent already 2 weeks looking at Angular 2, React, Aurelia, Cicle.js and recently Yolk.js. The Yolk looks good, also Aurelia is really impressive. If we're talking about innovative stuff.

from ama.

HighOnDrive avatar HighOnDrive commented on May 24, 2024

@alvipeo I think you meant Cycle.js (not Cicle.js) in your mention above. Cycle.js is definitely the one to watch out for. It drove it's point home at Reactive 2015 and there will be a new major release in the next weeks.

Essentially, the way Cycle is constructed allows it to grow fast, via it's driver and it's dataflow component solutions. It is not grafting on RxJS like every other framework is, rather it is built from the ground up for this new era of Functional Reactive Programming through and through.

from ama.

jeffwhelpley avatar jeffwhelpley commented on May 24, 2024

@HighOnDrive I totally agree that Cycle.js has some really interesting ideas, but I would be careful about anointing it as answer to everything. Check out this interesting thread):

https://twitter.com/mjackson/status/664858739565051905

I know that huge apps (i.e. ~1 million lines of code) can be built with Angular or React. I would be interested to see what a huge app would look like with Circle.js.

@alvipeo, it is a never ending battle if you want to try and work on the "best" and hottest framework. It is much better IMO (and more productive) if you instead just pick one that makes sense (Angular 2, React and Aurelia are all fine choices) and then bring the ideas from other frameworks into what you are working on. I think in general people tend to think they need to drop what they are doing and move on when in reality all they need to do is innovate where they are already at. So, just choose one and make it work.

from ama.

robwormald avatar robwormald commented on May 24, 2024

I'm a huge fan of Cycle, and it informs a lot of how I think about Observables when dealing with them in Angular2 design stuff.

Andre's talk What if the user was a function totally blew my mind and changed how I think about web applications in general. Highly worth a watch.

from ama.

joelhooks avatar joelhooks commented on May 24, 2024

Highly worth a watch.

This is quite a leap to go from here to "anointing as a solution to everything" 😺

It's been interesting to watch Cycle.js evolve from the scrappy collection of modular tools AndrΓ© used to build http://rxmarbles.com to a lightweight toolkit for building UIs with RxJS.

That Twitter thread is interesting, but also has much FUD mixed in! Some of it makes me sad, and makes me wonder if the author is being disingenuous, or is shooting from the hip with shallow research. I'm giving the benefit of the doubt, and going with the latter.

A computer is like a violin. You can imagine a novice trying first a phonograph and then a violin. The latter, he says, sounds terrible. That is the argument we have heard from our humanists and most of our computer scientists. Computer programs are good, they say, for particular purposes, but they aren't flexible. Neither is a violin, or a typewriter, until you learn how to use it.

If I was to start a project today?

Well, I can answer that, because we are starting projects lately, and using React. No questions.

It depends on the organization though. If I was highly invested in Angular 1, I'd be using Angular 1 with a component-centric approach. Angular 2 is looking sharp, and it will be interesting to revisit this question in 6 months.

RxJS and that entire ecosystem is going to be important in the near future. As we start to deal with inevitable issues of concurrency in the browser, it is going to play a part big-time. It's wonderful for async. It is critical for concurrency.

Cycle, Yolk, Elm, ClojureScript and Om Next... I'm paying attention.

from ama.

kentcdodds avatar kentcdodds commented on May 24, 2024

+1 @robwormald, that talk is super cool. Cheers @staltz

@joelhooks, agreed. Angular 2 will be interesting to look at when it's a real thing. There are so many cool things happening to JavaScript right now.

from ama.

alvipeo avatar alvipeo commented on May 24, 2024

ok, my journey getting me back to Angular 2 actually. I saw today that RxJS is incorporated in Angular 2 (in some way) and I like that very much.
As I'm looking on the new tech for a real project which will be supported for quite some time I need to be sure that tech is build to last. Now, with all due respect yolk and cycle do not look rock solid in this area. I mean Angular 2, React and Aurelia have pretty much everything behind them to be an actual real tech that will have support when the project is in production. Also, I'm not really a fan of frameworks with 0.x.y version numbers :) (again, for real projects). You could play with them, use them for your next pet project but that's about it.
Oh, and the more I learn Typescript the more I like it. So that is another advantage I see in Angular 2.
Let me tell you the reason I actually started to look around for a new tech. I basically created a set of components (directives) in Ang 1 and used them in some of my projects. About a month ago I had to basically make changes in some of those directives (services, etc) and I looked at their code and ... it just has to be another way, less Ang1-ish :)

from ama.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.