Quantcast
Channel: JohnMunsch.com
Viewing all articles
Browse latest Browse all 37

Angular 2 will not be a “failure” (whatever that is)

$
0
0
There’s lots of odd stuff I see here and there about Angular 2 being a “failure” or similar odd turns of phrase. I guess in order to really refute that we’d first have to come to an agreement on what success and failure constitute in the case of JavaScript application frameworks. React and Ember aren’t as big a success as AngularJS (at least not if you look at Stack Overflow questions, search volume on Google, etc.). Are they then failures? I certainly don’t think so. If so, most frameworks are going to get a big “failure” stamp on them.
Angular 2 may not sweep aside React, Ember, and AngularJS, however, there are reasons for some people to be interested in it and some of those people should probably adopt it in favor of  continuing with whatever they’re using today. Let me tell you why… Angular 2, or something like it, is the future.
I mean that in a very literal sense. Angular 2 is the future because it’s built from the future.

Angular 2 is built on future JavaScript

To adopt it you’re going to be strongly pushed in the direction of TypeScript. I’ll be the first to admit that I’m not in love with the “Type” part of TypeScript. I used strongly typed C++ and Java for a large part of my career and I’ve never mourned not having that strong typing in JavaScript.
But I love the extensive amount of ES2015 which it embraces and makes available to me now, today, for use in my apps. I could of course skip using TypeScript (or Babel) since Firefox, Chrome, Microsoft Edge, and (announced today as I write this) Safari are all ready to support ES2015.
However, there’s a fly in that ointment and it takes the form of IE11. Unlike IE8-10 which Microsoft effectively killed in January 2016, they’ve committed to continuing to support IE11 until they’ve end-of-lifed Windows 7, Windows 8, and Windows 10! Think about that for a second. That means that unless you’re willing or able to just blow off any user running IE11 (or an older version of Firefox/Safari/Chrome), you’re going to continue using JavaScript ES5 (circa 2009) for years and years or you can get used to using a transpiler like TypeScript.
Note: This is something which affects other frameworks just as much as it does Angular 2. Many developers are going to adopt a transpiling solution in the future to be able to start using modern JavaScript conventions even if they prefer to use React, jQuery, or whatever. Picking another framework doesn’t opt you out of this problem.

Angular 2 is built on future web browsers

The components you build with Angular 2 are designed in such a way that Google can easily leverage WebComponents technology to power them in the future for those browsers which support them. In fact, doing so will actually improve the quality of some aspects of the components because they will be able to use CSS contained very tightly to the component with no concern of outside CSS leaking in or contaminating the styling of pages which use them.
Again, WebComponents are part of the future for browsers. I want them today, I will want them in the future. In fact, I would like to imagine a beautiful future where I can build an app and mix-and-match WebComponents built using Angular 2, React, Polymer, etc. and it not be painful or slow to do so. Angular 2 is emulating a large part of what they offer today because they anticipate you’re going to want it anyway in a couple of years.

Angular 2 is built on modular JavaScript

Even if you’re using one of the fancy transpilers like TypeScript or Babel, or just the ES2015 support built into the cutting edge browsers, you still don’t have a great solution for loading JavaScript built in. The module loading recommended for the future of JavaScript is something you have to (again) emulate if you want to use it today. Angular 2’s solution for that emulation is SystemJS. It allows you to use import/export in your code so your HTML file only directly imports a small handful of .js files and the rest are handled by the emulated module loading code.
It’s the future; today. And, like the last two things I talked about, eventually it’s going to become an issue for developers of any framework. In this case no browser supports the functionality, even the cutting edge ones, so your choices are either emulate or do without.

Angular 2 continues the idea of a complete ecosystem

I credit Ruby on Rails for giving us the idea of a complete ecosystem which solves 80% of your problems out-of-the-box. You can say this isn’t “the future” like the three things above, but I would argue it is. I still believe that for most developers, a good framework which covers the bases well is a better bet than mixing together their own set of libraries for testing, routing, etc.
When you buy into Angular 2’s ecosystem, you don’t just get ES2015 JavaScript, modular JavaScript, and WebComponents. You also get solutions for unit testing, end-to-end testing, dependency injection, routing (though that sometimes appears to be the “router-of-the-day”… *sigh*), and event handling (RxJS is so much better than Promises, trust me). Also, you’ll get books and video courses (full disclosure, I’m working on Angular 2 Essentials right now), and be able to hire developers who already know most of your front-end stack before they start working. I consider that a powerful advantage.

In conclusion

Will Angular 2 be as popular or more so than all other frameworks? Maybe, maybe not. However, there’s enough here already to make it appealing to developers who are tackling multi-year projects and in need of a long runway without worrying that the framework they pick will likely become obsolete due to changes in the browser or language. For those developers, I doubt they’ll end up characterizing it as a failure.


Viewing all articles
Browse latest Browse all 37

Latest Images

Trending Articles





Latest Images