John Mann

John Mann

Angular 4 is out... but is it too late?


Angular 4 came out yesterday and not too many people flinched, or even noticed. So many people got burned when AngularJs 1.x was completely broken if you went to Angular 2. I recently read an article about the naming of Angular and it was almost comical. I'll summarize:

  • For Angular 1.x, you should call that AngularJS
  • For Angular 2 or greater, you should call that Angular
  • For Angular 4, they are using SemVer (which simply means, version with 3 numbers. Major.Minor.Patch (ex: 3.2.1 Major 3, Minor 2, Patch 1)

Wait what happened to Angular 3? Oh, it is because of the router. If you search for Angular 4 in Google, the first few articles won't be of the Angular.Io website, but articles explaining why 4.0. LOL!  Actually, Angular.Io doesn't even show up on the first page of results.

Here is the article I was referring to about router version and Angular 4

Size DOES matter

Angular 4 (and 2 for that matter) use TypeScript. A type-safe (or an attempt at type safe) JavaScript. It has angular core, angular client, angular http, angular router, and angular compiler. All different NPM libraries. So to use angular you will need to add a MINIMUM of almost 150k after compression and gzip of Angular (framework sizes here)

There is one of my favorite websites when I teach JavaScript called http://vanilla-js.com/ that compares vanilla-js framework :-) to other popular frameworks. Vanilla wins every time.  All in all it is amazing. I love JavaScript and what it can do with the browser, and even some amazing things on mobile now. However, the explosion of Node.js and the plethora of packages... oh wait, I'll save that rant for another time... back to Angular...

The learning curve of Angular is pretty steep. Of course, you can scaffold a quick hello world, and even data-bind to a few input fields, but you eventually, pretty quickly, have to write custom-directives, and then things get complicated quickly. There are amazing tutorials out there and the community is pretty supportive, but c'mon, don't you just want to write code and deliver something and not have to ask every 10 minutes on stack overflows on how to add a drop down list data-bind and then filter on that?

TypeScript and Angular

TypeScript is over-rated. TypeScript allows new developers to have training wheels to prevent them from writing bad code. It does force some good habits early, but after you look at what it generates, you can write that code yourself. I'm tired of hearing about "BUT IT DOES SO MUCH FOR YOU". Does it? Or have developers gotten so lazy that they want to go back to Visual Basic where they can drag and drop elements, and link them to their Access database and not a line of code written... oh wait, that is Swift development now. (Just kidding).

Angular 4 promises great things, but I'm not exactly sure what those great things are. After a brief search, all I found was articles explaining why there is no Angular 3. The reason for that as stated above is the router, but here is a great question that some posed... what if Angular-CLI has breaking change, and a new major version of the CLI is released to fix that, are they going to push new versions of Angular router, compiler, and core also, just to keep things in sync?

So with very little fanfare, Angular 4 is out. I'm not sure I care. I have recently using Vue.js and it is pretty amazing. If you looked at framework sizes above, you see it is the smallest. Also, it is strictly for views. It doesn't try to do too much. You should check it out: https://vuejs.org/

I guess my next rant will be about NPM modules and including 42 megs of files for your hello world project so webpack can compress, babelify can support previous browsers, and you can unit test with selenium/mocha/phantomjs, and compile your sass/less, and... you get the point.

Thanks for stopping by.  What are your thoughts/rants about Angular 4?

PreviousNext