This is part 2 of my
short series about JavaScript MVC Frameworks. It will explain why of all the existing frameworks, you should really focus on AngularJS.
Choosing the right JS MVC Framework
If you're just
starting with JavaScript MVC-Frameworks you'll feel the need to use "the
right tool" so that the time use is well invested. This post should help
you choose AngularJS - and only AngularJS - and feel good about it.
The Really Relevant Criteria
Let's skip the
religious parts of the discussion for now and decide what should determine the
ideal solution:
- We want a solution that's
simple enough to start with
- …but that still works when
things get complex as the customers wishes accumulate
- We want a solution that has
wide adoption - thereby ensuring thousands of examples and answers online,
and ensuring that we'll find employees and consultants that can help us
when we need help
- We want a solution that will
still exist and be popular and updated - in five years' time
- We want a solution that is so
widespread, that many helpers/plugins exist
- …ideally it would be
something of an industry standard
- …and work well with other
industry standards like jQuery etc.
- …and has reached the critical
mass of followers that is hard to beat
Some not so important criteria
- Microsoft promoted it for a
while, so it must be good
- It support IE6
- I know a guy that likes it
- I once heard that Google is
as evil as Microsoft…
- I like the syntax of
something
- It supports feature x a bit
better than the other one
What are the Options?
Basically, there are more than 25 JavaScript MVC frameworks. The most popular by far is AngularJS, with emberJS and a few others still developing strongly. The most popular in the Microsoft universe of communication is knockoutJS. We'll focus on these two, and I'll tell you more about it later.
Let's look at the score
|
knockoutJS
|
AngularJS
|
Simple to
start with
|
Yes
|
Yes
|
Scales to complex
solutions
|
No (see note)
|
Yes
|
Wide adoption
|
MS only
|
Yes
|
Contributions
|
Good
|
Great
|
General Interest,
searches in Google (to predict 5 years)
|
Low
|
High
|
Very widespread,
lots of 3rd-party plugins
|
No
|
Yes
|
Almost an industry
standard
|
No
|
Yes
|
Well integrated
with other standards
|
Yes
|
Yes
|
Critical mass
|
No
|
Yes
|
In case you have
some doubts about my answers above, here an additional note: knockoutJS is
basically just a templating engine. It doesn't even provide a real view
management, let alone route management or many other things you would need in
complex environments.The only reason most Microsofties know about knockoutJS is because it was made by an MS employee and promoted at many MS events.
Just for comparison: this is what knockout calls itself: Knockout is a JavaScript library that helps you to create rich,
responsive display and editor user interfaces with a clean underlying
data model.
Am I just promoting AngularJS because I'm biased?
Absolutely not! We (2sic) started with knockoutJS because we heard of it as Microsoft-events. We actually created some very complex solutions using knockoutJS - including a very powerfull help/faq system. But with time, we had to admit that it's very limited. Then AngularJS documentation finally got good. It was time for us to switch.
What about KendoUI or EmberJS?
Parts of KendoUI
were made open source by telerik - I guess to stay in the market. I believe
they are doing an amazing job, and they finally changed their communication to
be less Microsoft-focused. So in general, I do believe it has lots of potential
since it's a very good product, and it's great that it can be integrated into
AngularJS. But in terms of industry-wide-adoption it's too far behind. So if
you like it, use it as an AngularJS add-on.
EmberJS is also
gathering momentum - but nothing compared to AngularJS. I'm convinced it's
great - but Angulars Head-start is amazing. Since I have to focus my energies,
it's not an option.
And some Google-Trends
As you can see -
very, very clear.
The clear winner: AngularJS
You may have other
opinions based on specific needs - that's great. My focus is on making a living
based on my work - and this requires a clear future-focused strategy. The same
logic that made me chose DNN in 2003 - namely the core question of "what
will make it" also defines AngularJS as the one and only clear answer. So
even if another framework has some technical superiority - the sheer mass of
Angular-believers will ensure that this will be corrected.
Why not learn both knockoutJS and AngularJS?
This question popped
up once after a blog I wrote - and the answer again is simple if you look at
the big picture:
- If you are working only by
yourself and you're good with programming, then your brain can easily
handle multiple tools and you may even feel joy in mastering diverse tools
and technologies. So you would do this for the heck-of it, not for
strategic reasons - go ahead.
- If you are budget and success
focused, and need to work in a team, then multiple technologies mean that
every team member has to spend time learning each technology. Each member
will waste time making mistakes with each technology. You will also need
to standardize various ways to handle the same problem (based on
combinations of technologies already in use in a specific project). And
you will need to document a lot of things, because of these many toys in
use…
- …which is simply not cost
effective, and will also cause lots of problems in the future, when you
finally decide to focus on one system, but still have lots of hybrid
solutions out there which you must maintain.
Next steps
In the next parts of
this series we we'll look into
- What is it and why you need
it (done)
- Comparing the currently most popular
frameworks AngularJS and knockoutJS (done)
- A simple example how to use
such a framework
- The entire setup with data-delivery from the server - ideally without server code
- Discovering some sample Apps
for you to adapt to your needs
With love from Switzerland,
Daniel
Daniel Mettler grew up in the jungles of Indonesia and is founder and CEO of 2sic internet solutions in
Switzerland and Liechtenstein, an 20-head web specialist with over 600
DNN projects since 1999. He is also chief architect of 2sxc (2SexyContent - see forge), an open source module for creating attractive content and DNN Apps.