Softwire Blog


AngularJS vs KnockoutJS – Part 3


15 September 2015, by

In previous blog posts in this series, we examined the motivation behind some of the modern JavaScript frameworks that aim to make front-end code more maintainable. We also examined AngularJS and KnockoutJS as specific examples of how they individually integrate data models with HTML views.

This blog posts aims to compare how well the two work: we don’t want to fall in to the trap of suggesting that they are competing with each other as they both do different things. However, as two libraries that make front-end development easier through attributes, it’s rare you’ll use both and so you’ll often reach a time on a project where you have to make a decision between two.

Setting the Framework Up

Setting KnockoutJS up is as easy as you’d like it to be – you can pull the source file into your project by downloading it, linking to their CDN or using package management tools such as Bower. It works nicely with all major dependency tools such as RequireJS, or can be included globally in your project. All you need to do to get it working is call ko.applyBindings in one place. It works nicely with all of your code, and can be added at any stage in the project as it plays nicely with other libraries.

AngularJS is a bit more of a tricky beast – building a project around it from the beginning is not much more effort than KnockoutJS. There’s slightly more boilerplate at an early stage to deal with modularisation, but these costs are mostly compensated by not requiring the set-up of, say, RequireJS.

Adding AngularJS to an existing project, however, is significantly harder. Because of the opinionated idioms that come from the use of AngularJS, it’s often hard to make it integrate seamlessly with other code you’ve already written. We’ve used AngularJS with other module loaders, for example, but the cost of maintaining that has been far higher than expected.

Conclusion: On greenfield projects, both libraries perform well. KnockoutJS is easier to add incrementally to an existing project.

Browser Support

A minor point, but if you have to support Internet Explorer, then you may have a harder time with AngularJS that has a small number of outstanding issues on all IE builds; and no support for IE versions 8 and under. KnockoutJS goes all the way back to IE6.

Conclusion: If IE6 or 7 support is important, AngularJS cannot be used.

Community Support

One of things that makes JavaScript fascinating (or, if you’re one of the front-end nay-sayers: tolerable) is how fast the community moves. There are now more npm packages than there are Maven Central libraries, showing just how fast people rally behind languages to bolster its features.

We have to be careful about comparing raw statistics of two libraries of differing sizes. In terms of Google Search trends, AngularJS is over 12 times as popular, and exponentially rising. Angular is the second most installed bower package, whilst KnockoutJS doesn’t make the top 100.  The trends certainly suggest that AngularJS has more staying power.

AngularJS’s modular nature makes it a natural fit for community support as people can add directives, modules and services that can be easily pulled in and integrated with your code. This means that if you’re requirements are common, then you can use a large number of off-the-shelf libraries.

KnockoutJS does allow you to write bespoke additions by creating your own bindings, or extending the knockout object itself in an easy and well-documented manner. Although there are some KnockoutJS libraries to add features such as Pager.js for routing, there are definitely fewer. At least a few times I’ve thought “Surely someone’s done this already” when writing features with KnockoutJS.

Conclusion: AngularJS is much more popular, and has more community libraries.

Ease of Learning

The documentation and online tutorial for KnockoutJS are some of the best I’ve seen. Knockout is so simple and light-weight that when new developers see it, they’ve always taken to it immediately and are able to contribute to development teams very quickly.

AngularJS is a much bigger beast. Their documentation is, necessarily, much more heavyweight and bulky to reflect the larger amount of things that people have to learn. Almost everyone who has worked long enough with AngularJS is now happy with how it works and can contribute speedily, but it often takes longer to reach the same depth of understanding.

Conclusion: KnockoutJS has simplicity and brilliant documentation on its side; the larger AngularJS can’t compete.

Testability

AngularJS was made with testability at the very front of its mind, and there are lots of guides online about how to set up unit and integration testing on your AngularJS modules. We’ve had great experiences running our JavaScript unit tests on such projects with Karma and WallabyJS giving us instant feedback when things fail.

KnockoutJS is unopinionated about tests – it’s a much smaller library so we wouldn’t expect anything else. If KnockoutJS is used with some modularisation frameworks (which we always strongly recommend!) then good discipline, such as encapsulating all low-level DOM manipulation, makes unit testing no harder than with any other library.

Conclusion: Both libraries are testable, though AngularJS was written with this very much in mind, making set-up marginally easier and more documented.

So, which is better…?

We’ve found in projects at Softwire uses for both frameworks.

We typically favour KnockoutJS on projects that have less need for the larger, more opinionated AngularJS. This could be because there is less complex interactions between the user and the data; or because the project simply runs for a shorter time. For legacy projects, it allows us to use it minimally only where we need to, preventing a large initial investment of effort. A lot of developers here love KnockoutJS and many use it on their own pet projects because of its light-weight approach.

We have, however, used AngularJS successfully on a number of projects. We’ve found that the ramp-up time is slightly higher, as it takes control of more aspects of the code base. However, if there is sufficient complexity or on a project, or the code base is larger, the initial set-up and learning costs on a project quickly repay itself and it becomes our framework of choice on large projects with potentially complex user interactions.

We are, as we are with all technologies that we use, constantly examining the ecosystem for new and maturing options outside of these! For those interested in seeing more frameworks in action, TodoMVC is a great website that codes the same site using multiple different libraries.

David Simons trains developers in High-Quality Front-end JavaScript. Sign up to his next course here.

AngularJS vs KnockoutJS – Part 2


8 September 2015, by

Previously, we looked at one of the most talked-about family of JavaScript libraries: those that follow the MV* pattern to decouple the visual concerns of a web application from the data-driven business logic. This blog post serves to give a brief introduction of two of the most commonly used such libraries – AngularJS and KnockoutJS.

(more…)

AngularJS vs KnockoutJS – Part 1


1 September 2015, by

In Softwire, we’ve used AngularJS and KnockoutJS on a variety of projects, and have found that this makes web development a lot easier and a lot more pleasant! With this series of blog posts, I’m hoping to share what we’ve found out about these, and other, data-binding libraries along the way by looking at:

  • What groups all these libraries together?
  • How do these libraries work?
  • Which library is the “best” one?

(more…)

Announcing Softwire’s Technical Training Courses


14 August 2015, by

At Softwire we’re hugely committed to helping our employees build their skills – we can clearly see the value delivered by our investment in training paying off in team and individual performance. As we’ve grown as a company, this type of internal training activity has become an increasingly important and valued activity, and many of our more experienced staff have discovered a real passion for sharing their knowledge and experience.

We’re therefore tremendously excited to announce that starting later this year we’ll be opening up our technical training to a wider audience and offering it as another service to site alongside our existing software development and consultancy options. We think Softwire training offers a powerful combination of both a depth of real-world experience, built up over 15 years delivering high quality software projects, and a fresh and up-to-date perspective driven by our focus on staying abreast of the best emerging technologies.

We’ve created a schedule of courses this Autumn covering a wide range of different areas including:

Developer-focused courses

Technical leader courses

Business-focused courses

As a result we very much hope there’s something for everyone there. On top of that we’ve also partnered with the brilliant Seb Rose and Liz Keogh who have both hugely impressed us at conferences in the past to join us and deliver their own insightful perspectives with courses on “Agile Software Architecture” and “Behaviour Driven Development with Cynefin” respectively.

You can view full details of our courses on the links above. We’ll also be talking about a few of them in more detail in future blog posts.

Are we nearly there yet? Practical tracking on Agile Projects


28 May 2014, by

In April 2014  Ric Hill, the founder of our Bristol office, gave a talk at Bristech, a monthly meetup where developers are encouraged to give informative talks about computing.

This is his talk on Practical tracking on Agile projects.

Softwire’s Key Responsibilities #4 – Take active responsibility for your own personal development


6 May 2014, by

Previous article in series

You can lead a horse to water, but you can’t make it drink. At Softwire, we’ve never tried to force training on anyone, as we consider it a very unproductive use of our time. If you’re not bought into training, then you probably won’t get that much out of it, and more importantly, if you don’t care about your personal development, why should anyone else?

In a similar vein, we try our best not to decide people’s career paths for them: we feel like we should get much better results by waiting for people to decide for themselves what they want to do and how quickly they want to get there.

However, there’s a real risk that this philosophy can be used as an excuse for not providing training, support and opportunities for career development. We do our absolute best to ensure that this isn’t the case, and I hope we’re succeeding. Here are some of the ways we provide this support:

Skill levels and mentors

Not everyone is going to follow the same career path in Softwire, but most people’s paths will look quite similar for the first few years (c.f. the Helsinki Bus Station Theory). For this reason it’s worth everyone knowing the kind of skills, both technical and “soft”, that are most useful to Softwire and have historically helped people to rise to more senior positions. So we’ve written them all down and, via our mentoring structure, helped people to understand which ones they’ve already learnt and which ones they still need to learn.

Linking these skill levels to our end-of-year bonuses is just good business sense for Softwire, but hopefully also provides the right level of “nudge” to individual developers to get thinking about them – while providing plenty of scope for people to learn other skills too.

Training tracks, Lunch&Learns, blog posts, conference passes…

It turns out it’s actually really easy to foster a culture of learning when you exclusively hire people who are enthusiastic about technology. People from all levels of Softwire have written training tracks, given lunch and learns, written countless technical blog posts, and found loads of amazing conferences to attend or talk at – including our very own annual SoftCon.

And when we asked people what our social calendar was missing, the answer was “more technical stuff!” – so we now run speed coding challenges, mind sports olympics and plenty of other geeky events. If you don’t learn anything from all that, you’re not trying hard enough!

Friday Lunch and Learns: TDD and Clean Code


10 September 2013, by

Every Friday lunchtime at Softwire we all get lured into a meeting room with the promise of free food, and one of our colleagues gives a talk on something they’ve been working on recently.

We filmed this talk on TDD and clean code, by David Simons, so that others can enjoy it too.

Friday Lunch and Learns: Contributing to GitHub


16 August 2013, by

Every Friday lunchtime at Softwire we all get lured into a meeting room with the promise of free food, and one of our colleagues gives a talk on something they’ve been working on recently.

We filmed this talk on contributing to GitHub, by Will Pragnell, so that others can enjoy it too.

Friday Lunch and Learns: Attributes


2 May 2013, by

Every Friday lunchtime at Softwire we all get lured into a meeting room with the promise of free food, and one of our colleagues gives a talk on something they’ve been working on recently.

We filmed this talk on Attributes, by Camille Baldock, so that others can enjoy it too.

How we run a software company: Learning from each other


3 April 2013, by

One of Softwire’s core values is aspiration: employees are encouraged to strive for continuous improvement, both for Softwire in general and for their individual contribution to its success. One of the best ways for this to happen is for employees to learn from each other. There are a number of different ways in which we spread knowledge around Softwire, which include (but are not limited to!):

Lunch and Learns

Every Friday lunchtime an employee holds a Lunch and Learn – these are an informal talk which can be on any topic that the speaker thinks would benefit Softwire; in the past, these have included talks such as ‘The rapid pace of web development isn’t rapid enough’, ‘Basic F#’, ‘Presentation Training’ and even ‘How to Manage Your To-Do List’. Employees get together each Friday lunchtime to listen to the talks, plus anyone attending gets a free lunch so they are usually pretty popular! The aims of Lunch and Learns are to:

  • Let others know what else is going on in the company and how they are doing it
  • Be more sociable between teams
  • Improve confidence within the company with respect to public speaking and presenting
  • Share technical knowledge and expertise within the company.

Lunch and Learns are a great informal setting for people to learn about something new. We’ll continue to post videos of recent talks on here, so you can see for yourself!

 Wednesday Whiteboard

Matthew has recently started Wednesday Whiteboard, a session in which he explains a subject that he is knowledgeable on to a small group of people who think they don’t but want to. So far these have been very successful, with both Matthew and his audience learning from the process! The first Wednesday Whiteboard was so popular in fact, that Matthew ended up doing a Friday Whiteboard in the same week, so that everyone who wanted to could attend.

SoftCon

A couple of months ago, we held our first ever in-house conference, SoftCon! It was a very popular event and people learnt a lot from it. We’ll no doubt be holding more SoftCon events in the future.

On top of all this, we also have the following:

  • Training tracks: experts in a particular field compile a course of recommended books, activities and online resources for their colleagues to work through
  • Lightning talks: A couple of months ago we held our first ever Lightning Talks competition
  • Quarterly company meetings where the directors provide updates on and plans for the company, and discussion is encouraged
  • Dinner forums – a group of employees get together once every couple of months with a director and discuss anything they want in regards to the business over a nice (paid for!) dinner. Minutes of the discussions are sent around the company afterwards so that everyone knows what was discussed and people are free to raise any other queries they have as a result.
  • Morale events, such as Speed Coding, Battleships and Project Euler evenings.