Thursday, November 21, 2013

Why Am I Getting Addicted to AngularJS ?

Modular. Testable. MVC framework. Dependency injection. Backed by Google.  Did I mention testable?I'm getting addicted

First, let’s go back and look at how I got here.

I started writing code in the 1970’s in high school.  Everyone knew the languages were inadequate.  Structured programming was the next thing.  Tom DeMarco was my hero.  “Interactive programs” were just starting to appear.  My first big “UI” was a command line system.

Roll forward past years in quantitative analysis, sales manager, general management to a time as an entrepreneur.  .NET was just about to come out the door, and would replace web programs written in ASP.  For a limited number of web page actions, we could choose between vbscript and JavaScript.  The notion of doing anything serious on the browser, with either of these immature, class-less languages, was not on anyone’s radar. “No serious developer writes in JavaScript” was unsaid, but understood.

Today, people want multi-platform applications that are simple, responsive and offer an intuitive, rich experience. No arguments there.  The challenge has been the lack of comprehensive tooling to deliver these applications.  Sure, MVC applications in .NET and java can produce superb and organized solutions and tool sets for complex problems .. But that last mile – the RICH user experience – had to be done on the browser, with JavaScript.

Developers were introduced to jquery, underscore, bootstrap and a litany of widgets, tools and add-on, extensions and variations galore.  These gave us the power to bond data, manipulate DOM and offer nice transitions, feedback, etc…  the little (important) rich stuff.  Libraries bloated the size of the code base.  Developers would include a library because of 1 function, and who knew where the code came from.

But then users and clients demanded more.  They wanted it to be really fast.  We were told “no flashes between pages”. “We want it to work like an iPhone app”. Suddenly the need for Single Page App (SPA) was born.  People also wanted what they got from great MVC apps: deep linking, routing, seamless communication with external data services.  Developers had gotten used to dependency injection, mocking, and testing every little piece of logic.  Quality and productivity that was delivered in the server-based MVC environment had to be delivered for browser based apps.  And end-users knew it was risky when they had a pile of JavaScript (from a dozen sources or more) pasted onto a page.

But how do you write a substantial (a few thousand lines) SPA in a language that has no real class structure, funky namespacing and a morph-able nature?  Make modules, use closure, etc? Yep, but they miss the big the big things we were used to.  True MVC, built-in testing and mocking, dependency injection, services, etc., etc,  So how do you write an “industrial strength” application in JavaScript?

How?  AngularJS.  I’ve been ‘doing it’ now, after checking out a whole host of options, for 3 months …. just a few months after its popularity has jumped ... and I have to admit .. I’m getting addicted.

No comments:

Post a Comment