97 points · by nfriedly · 11y ago · 59 comments
> Several months ago the general direction of Angular 2.0 began to change in critical ways. I found myself fundamentally at odds with certain aspects of the proposed design. Still, I tried to keep an open mind and explore the various possibilities. Unfortunately, I haven't been satisfied with how things have progressed since then. At this point, there are too many irreconcilable differences. The Angular that's being built is not the Angular I signed up to work on
It looks like the new version does away with some unnecessary concepts (Angular itself has way too many concepts to deal with IMO) and adopts upcoming standards like module syntax. (The AtScript stuff does seem like sort of a nightmare, though apparently only contributors need to worry about it.)
I hated the time I spent with Angular 1.x and the whole thing strikes me a as a complex and painful way to build applications. But the new stuff seems like a slight course-correction if you want to build apps in that way.
This comment baffles me. Not your cup of tea, sure, that I can understand, but complex and painful? Angular, Ember, Backbone, React, etc. are all so vastly superior to hacking together jQuery spaghetti code with imperative DOM manipulation I can't understand how anybody wouldn't be elated with the productivity gains they get from any of the modern frameworks, regardless of their syntax preferences.
About the complexity part, I am referring to the number of concepts one must be familiar with in order to produce a working Angular app. I mean read TFA: part of it breaks down the three varieties of directives you need to know in order to do a thing.
And it's all like this, just a constant array of made-up concepts you have to digest in order to make something happen in the DOM. It's such a pain in the butt, and you constantly keep running into it -- whenever you need to output a URL to the view, you get to go hunting for the docs for $sce and figure out your exact use case just so you can spit out the damn URL.
As a massive fan of Typescript I'm not convinced it is actually that much of a problem. But when you see the JS you have to write to achieve what AtScript produces it's going to be pretty painful for someone who wants to stick with JS.
> What I am saying is that it is no longer fundamentally the same thing I was originally hired to help build nor is it compatible with my vision for the future.
I've heard elsewhere that 2.0 will be an entirely unrelated framework which will be still called Angular for no good reason.
Dismissing this opinion as a troll is no longer productive after the above commentary by an Angular developer.
I'm skeptical of several things, but so far trusting that team has gone well for me.
What's wrong:
1. UIs are complex. Angular tries to solve this by attaching a lot of programming capability into its templating language. That makes the template itself very complex, which is the situation with Angular right now. Instead of injecting some programming capability into html-like templating, a better way would be to insert templating into a full programming language. Example, JSX.
2. One of the great things about the evolving JS ecosystem (as seen in say, the npm registry) is that components and libraries are tiny, and usually they do only one thing. While there are a few disadvantages to this, it also gives incredible flexibility. From my experience it reduces risk (because components are smaller and better understood) and makes it possible to adopt newer ideas/tech faster (because you could incrementally add small components). Angular on the other hand, tried to do too much.
3. Frameworks should enable users to re-use what they already know, instead of making them go through dozens of pages of documentation. Learning Angular takes as much time as learning JavaScript. We should encourage libraries which take advantage of what programmers already know, so that they can spend time working on features instead of learning the framework.
I do agree with #2, and it is a large part of why Angular is changing so drastically with 2.0 - part of this can be evidenced in 1.x with components being split into official optional modules (ngRoute, ngSanitize, ngAnimate, ngTouch, etc.).
I somewhat agree with #3 - I feel like in order to properly use any framework, there is no way around combing through documentation and the source code. I have found that true with most libraries I have used. Angular's documentation at least has the benefit of being very thorough compared to most at least. I do disagree that libraries should only use what programmers already know though - we should be pursuing how to best foster productivity in the long term, and sometimes this means exploring new patterns.
However if they managed to understand directives, digest cycles, dependency injection, MVVM, angular services, $scope, controllers (confession: as an amateur I haven't been able too), handling JSX build step doesn't seem like a stumbling block.
I am fine working with this sort of tooling myself, but it is more of a concern coming from a lead/senior engineer viewpoint.
Frameworks are DSLs.You have to learn its API and its architecture.
There is a reason we old timers are usually sceptic of new frameworks/languages.
These days I just stay away from those projects and watch them burn.
Then again, I am glad the project is now gone, given the direction AngularJS is going.
Personally, I still like using Backbone.js. I liked it from the start because I could read and easily comprehend the entire codebase. That might be a decent rule of thumb before getting very invested into a tool/framework/whatever.
At work we have some old projects built on GWT, some newer projects built on AngularJS and both will soon be outdated.
Also there is no real choice to build a modern web application, that clients now expect, while being really future-proof. That's the first time I see a situation like this, typically you need to pick between shiny new tech vs old boring one.
I guess this confirms it -- Angular really is the modern Visual Basic.
React also enforces certain restrictions by default when it comes to mutating data. While Angular encourages "two-way binding" where data can be changed by two different sources (e.g. the controller and the user changing the input field), React encourages a strict policy of one-way data passing. It is possible to restrict Angular directives to function exactly like React components, however, if you subscribe to React's core philosophies about data handling. For large applications, though, React applications get messy as they need to pass data down a very long tree of nested components. They wrote the "Flux" pattern to address this concern, but it really ends up looking like yet another version of MVC (although I like it, personally).
Where React and Angular differ dramatically is in how they handle templating. Angular's philosophy from the start was to embrace HTML and a declarative programming style. They believe HTML should be embraced and extended using "Directives" which is very much in-line with the philosophies behind the coming Web Components standard. React's team, on the other hand, challenges long-held assumptions about web development like not including markup in your code, opting instead for a framework that not only encourages it, but requires it. This is a controversial aspect of React, but it makes sense when you actually try it. Some logic is better written imperatively (like if statements, map/reduce, etc.) and it's nice having everything required to render the component in one file. It does, however, require a compilation step unless you use their imperative DOM manipulation library so in that respect Angular is far easier to get up and running with (which is part of its dramatic success).
In my mind, the only aspect where React really has a clear advantage is the ability to run server-side, which allows you to pre-render components before sending them to the client. This solves a variety of SEO and time-to-render issues single-page web applications often struggle with. The only caveat is that single-page apps don't typically need to be SEO friendly (like gmail or google docs, for instance) so it remains to be seen how important this differentiator really is. The React team admits it was really a happy side-effect of the virtual DOM and not really the main reason they built it, but it's compelling nonetheless.
One last thing I'll mention is that currently it's a very difficult time to pick a horse in front-end development world. All signs point to Web Components becoming the next big thing, but React has made a lot of people question whether or not that's the correct approach. React has not made it a stated goal of theirs to align with the Web Components specifications like the Ember and Angular teams have. I can't say whether this is incredibly wise or foolish, but again, it's compelling.
edit:
I forgot to answer your original question directly:
> Does it use the one-way-only data-binding powered by shadow DOM
It allows for both the use of one-way binding and two-way binding, which React actually does too (although React's core team discourages using two-way binding). Neither is powered by shadow DOM so I'll assume you meant virtual DOM. I kind of answered this above but to re-iterate, both frameworks build up virtual representations of the DOM in memory to better serve data-diffing, but they both chose different mechanisms for doing said diffing which is outside the scope of this post but definitely interesting to learn about. The important point to take away is that you can restrict Angular directives to function exactly the same as React components, the only functional difference being the diffing algorithms under the hood and the templating systems used.
I think the one thing that I would change for Angular 2.0 is the project name. With so many of the framework elements being killed, and the whole thing rewritten from scratch on a different language (AtScript, compiled to JS), with a different API, with different paradigms, the name "Angular" and the expected meaning it's built up to all developers involved doesn't apply anymore.
I will soon need to update my resume to say that I'm experienced in Angular 1.x. I'll need to ask people developing projects built on Angular, "But which version do you use?" I'd say the same gripes apply to Python 2 vs Python 3.
I don't want to go all Romeo and Juliet on the name here, but maybe there's room for a semver 2.1 that specifies the hitherto-unspecified contracts you can expect to be upheld if a project keeps the same name.
For example, I still using ExtJS 3.1.1 in some projects, even the 4.x version is available for a long time, so, i totally agree with you.