A few words on Angular.js

So I spent some time this week to fiddle with Angular.js. They have a great tutorial worth checking out. But truth be told, I really didn’t like it and as far as I’m concerned, I don’t want to work with it in the future. I’ll tell you why:

  1. Angular doesn’t tolerate full separation between structure, code and style
    I believe HTML should be clean from any javascript code and any CSS styling (with the exception of expediting the loading procedure). full- separation allows you to replace any of the segment easily; it saves you the need to go look where some JS code was written (in the JS file, obviously!); it help you split the job to several people where the only API between them is ID for JS and classes for CSS. full- separation helps you write better code.
  2. Angular works only on client side
    Sometime the javascript is disabled, or the JS file simply failed to load. what will happen? will the user gets some unreadable information or maybe we can serve him with the bare minimum he actually wanted to read in the first place? Also, how much time will it take the page to load? wouldn’t it be better if the important data will show up instantly and only afterwards the FX will load up?
    The great benefit in using XSLT for templates is that it can be rendered on both client-side and server-side (and by any language!), so you don’t need to write the code twice.
  3. Using angular template means making an extra call to the server
    Each call to the server has a lot of overhead and slows down the page-loading. This is also true for client-side XSLT, but the big difference is that one XSLT can hold many templates (so you’ll get 1 additional call) while in Angular, each template is a file on its own (so you’ll get a gazzilion calls. Lucky for you they’re cached).
  4. Angular encourages user to invent new HTML tags
    That might sound great because the developer can easily read the page skeleton but as a designer it’s bad, because you can’t tell what are the HTML elements formulate the new element. for example:

    <products>
    <product></product>
    <products>
    

    while this version maybe less readable, but contains the same information and is much more easy to understand:

    <ul class="products">
    	<li class="product">...</li>
    </ul>
    

So I prefer to stick with my XSLT, which works on both client and server sides and can be used by any language and is provides better performance than Angular.JS (less calls, computes on the server)

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.