By Scott Miller, Senior Software Engineer, Pulsion Technology

Introduction

When planning development for a new modern-day web application, it’s hard to conceive of developing it without using JavaScript. Indeed, as time goes on JavaScript plays more important a role in web development, regardless of what your development language of choice is. And, as is the way of things in the modern world, it all changes so quickly. Here in Pulsion, we’ve recently been discussing standardising what JavaScript front-end framework we use across all future web development projects, regardless of the back-end language used for the website (be it .NET, PHP, Python, whatever). But, with the wealth of choices of JavaScript UI frameworks out there, this is far from a trivial decision. You have Angular and React as arguably the biggest players here – and then others such as Ember, Backbone, Vue, Meteor, and the list goes on. Over this 3-part blog series, I shall discuss our investigation and our conclusions.

Overview

Now, in an ideal world, we would work on a few enterprise level web applications using each of the popular modern JavaScript frameworks, and then based on the extensive experience we’d gain from those projects, we’d decide on what one we preferred for future projects. But, as is too often the case, this world is not ideal. So the approach was taken of getting a number of developers of differing levels of experience and different language backgrounds to do some investigation into the different frameworks, the pros and cons of each, and then to combine that information, together with their past experience, to come up with an overall recommendation on what one we want to use for future projects.

Angular

The first version of Angular was extremely popular: it was widely adopted by the tech community, which was aided by it having the backing of Google. In Pulsion, we’ve developed a number of web applications using Angular 1 in recent years. Overall, it was found to be very responsive to use, and pretty easy to pick up. The MVVM pattern it used was familiar to anyone who had worked with any kind of MVC framework in the past. However, it did have its drawbacks. It was found that directives in particular were really not intuitive. Also, if you had a number of different nested layers of scope, things could start to get confusing really quickly! So it was with this background that we looked into the modern version of Angular (version 4 at present, version 5 currently in beta).

The first thing of note is how different Angular 2+ is from Angular 1. It’s essentially a completely different framework, which has simply retained the Angular name. They’ve moved Angular to using TypeScript, using a component architecture where each component will follow MVC/MVVM pattern. The use of TypeScript means it’s easier to write better code, and the component architecture means it is easy to re-use code. It also has a marked performance improvement compared to Angular 1.

There did seem to be some down-sides to Angular 2+, however. Although it’s easy enough to write a basic demo app, there looks to be a fairly big learning curve involved if you’re going to be getting into the complexities presented by an enterprise level web application development project. In addition, the 2-way data binding that is used by Angular can be as much of a curse in some scenarios as it is a blessing in others. It’s great if you’ve got a simple webpage with a few fields. However, if you’ve got a complex webpage consisting of nested components with lots of inter-dependencies in fields, it could become very easy to lose track of exactly what the 2-way data binding is actually doing, behind the scenes: it simply becomes “magic”. And to a developer, “magic” isn’t good!

In part II of this blog series, we’ll take a look at another JavaScript front-end framework that has become popular in recent years: React.

Meantime, please feel free to leave a comment, or if you have any questions on this or any other software development topic, then please don’t hesitate to contact us on info@pulsion.co.uk or 0141 352 2280.

Pin It on Pinterest