From ActionScript to Javascript (part 2)

A continuation (From ActionScript to JavaScript part 1)

JavaScript has come along way, from a simple client-side scripting tool to a versatile and flexible programming language, i’m impressed! Thanks to Douglas Crockford’s book, he helped identify the areas of JavaScript that I don’t want to mess with and most importantly the strengths of JavaScript and how to use them. If you are an engineer and are tasked to write JavaScript, I would advise you to read the book. After refreshing my JavaScript knowledge I moved onto the task of searching for the best JavaScript MVC framework solution the community had to offer. If you are new to JavaScript, you may be wondering why I would prefer to use a modern framework vs. writing a web application from scratch. The simple answer is, I don’t want to get stuck in the world of JavaScript spaghetti code relying on DOM manipulation using JQuery with a bunch of plugins, getting lost in JQuery callbacks and nested DOM elements without a structure. I want a framework that has structure and organization, allowing multiple devs to contribute and speed up the development process, amongst other cool features like UI Binding (if you are a former ActionScript dev, you should be familiar with the concept), Composed Views (reusable components) and a web presentation layer.

Be forewarned, you are about to enter the world of information overload, a land of many options. Maybe there are to many frameworks to choose from? I believe, in part, it’s due to how many different JavaScript developers interpret how a scalable JavaScript application should be organized. This was a source of confusion and frustration for me. All I wanted to do is start writing my app and not have to manually evaluate 10 different options in order decide what was going to be maintainable. Besides, I found that the differences between some of the frameworks can be very subtle to distinguish. Starting off with my previous list of nice to haves (mentioned above) and adding the following:

What does my project require?

What large public applications are accessible? (What does Google or Twitter use?)

How mature is the Framework? (documentation, active community)

Is the framework flexible?

What are the framework dependencies and how big is the overall file size?

I ended up choosing Angular.js. I’ll get to why in a minute! I must confess, I started off researching available JavaScript frameworks and stumbled across TODOMVC.com . What a blessing in disguise, it’s a great tool to help narrow down your framework selections and I advise you use it. Now, why Angular.js? Simply put, I feel a bit at home with it, since it has similarities to ActionScript, especially the 2 way binding. It feels intuitive, it has decent documention, nested scopes, a small footprint, reusable code (directives), dependency injection (just like Robotlegs), and you can carefully remove JQuery from manipulating the DOM. Oh, and it’s maintained by Google, so I assume it will only get better with time. I found that the ecosystem around AngularJS is mature, responsive and collaborative. You can find many Angular.js seed developments in many flavors on GitHub. I feel confident that I have chosen the right framework for my project and I’m ecstatic to become an Angular.js seasoned pro.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: