Professional Documents
Culture Documents
Abstract — “Time is money” is a common expression frontend frameworks until 2021. The paper focuses on 2
within the development. Developing web application research questions (RQ):
nowadays consist of more than just code. Frameworks are RQ1: What are the comparable characteristics between
the key to this success; it provides the developers with built- React and Angular?
in function to save time and money. Usage of frameworks is
a crucial technology to be successful in developing business. RQ2: How do these characteristics differ between React
However, numerous front-end development frameworks and Angular?
and libraries have been released and adopted widely To answer RQ1, we will go through the following
amongst tech communities and research. Amongst those, characteristics: Data Binding, Templating, Extensibility,
Angular and React have been emerged as two of the most Variable Observation, Routing, Testing, and other advanced
popular web technologies starting from 2017. Each of these features such as Dependency Injection, Form Validation, and
technologies has its own unique advanced features and Browser Support. For RQ2, We then discuss each framework
outstanding capabilities. This paper will guide us through from these different aspects to analyse its usage, strengths, and
the differences in strengths and weaknesses of these limitations from different angles versus other similar
frameworks, which in turn will provide us good insights on frameworks.
their pros and cons depending on what type of web and
mobile applications development project.
II. BACKGROUND
Keywords—Angular, React, JavaScript frameworks,
software architect, software quality, single-page applications In 2008, Google released the Chrome V8 engine which
adequately addresses the issue with HTML's rendering
efficiency and performance, which brings JavaScript to the front
with HTML5 [1]. Before the advent of Chrome V8, JavaScript’s
I. INTRODUCTION primary function used to be working with CSS to enhance UI
Consumers are more and more reliant on digital services and responsible for some actions such as form validation. The
accessible via mobile and web-based applications. These traditional compiling process, interpreting byte-code and
applications comprise mainly of 2 components: frontend and compiling the entire web project to execute them later from a
backend. Front-end also known as the client, includes the file system, consequently slow down JavaScript running time
browser and the mobile app client. Meanwhile, the back-end tremendously compared to that of compiled languages like Java
includes all the functionalities that are available on the server or C++ [2].
(database, authorizations, authentications, etc.) In 2009, Node.js was released as a new development
This paper focuses mainly on the frontend side, where all of platform combine with the V8 JavaScript engine [3]. Node.js
the best user experience, as well as user satisfaction, reside. The shifted developers’ mindset on what JavaScript can do in writing
demand is so high that there is a growing area of new an event-driven server-side application with simpleness [4].
frameworks, platforms, and IDE tools that supports all aspects The arrival of new technologies like these opened a new age
of client-side development life cycles. In addition to that, with of web development, where web projects can now meet the
the arrival of powerful HTML5 features, and the performance comparable speed as traditional desktop software. This leads to
enhancement of modern web browsers, developers now have emerging numerous front-end frameworks and libraries based
wider options to dictate how they can construct websites with on JavaScript. Until the end of 2020, there are 5294660 React
more sophisticated capabilities than ever before. Therefore, repositories, and 1630131 Angular ones on Github. Consider
choosing the right framework that fits the desired solution Angular has published its updated version, the paper will
becomes both a concern and a challenges for all stakeholders. combine the technical detail with Angular 1 and Angular 2. In
In the field of front-end development, there are several the following sections, the paper will focus on React and
competing frameworks and libraries. This paper focuses only on Angular 1&2.
Angular and ReactJs, which are some of the most popular
A. Angular In essence, React mounts website content as different
components into the Document Object Model(DOM) which
AngularJS was first launched in 2009, as part of a then be rendered efficiently by a new browser rendering engine.
commercial product, under the name of ‘GetAngluar’. It
achieved great benefits by simplifying and reducing the web
application development process. The ‘GetAngluar' project later
became open source thanks to Google's sponsor and promotions;
hence, the name "AngularJs" was coined [2][6].
The core concept of Angular1 is two-way data binding [6],
which enables web browsers to process, update and render data
dynamically on the frontend. There is almost no need for
backend involvement and user experience is also enhanced
tremendously due to low latency and high responsiveness.
However, Angular was left behind other front-end
frameworks in recent years due to many of its initial design
limitations. Being aware of that fact, the Google development Figure 2. Mounting components in React & Re-rendering
team introduced an upgraded version of Angular, which is a components in React [9]
complete rewrite of the old one in 2016, named Angular 2.
One of React’s core wisdom is creating a virtual DOM [8].
Angular uses ES2015 and ES2016 in addition to In traditional HTML websites, when the user interacts with the
‘Typescript’ as a compiler, which supports classes and module UI and causes data updated, the page is rerendered entirely. This
loaders. Although Angular requires substantial effort to set up, process consumes a lot of browser resources which in turn
it provides a clear understanding of how components interact affects website speed performance. React tackles this problem
with each other. Below are some main differences between by creating a virtual DOM with one-way data binding. For
Angular 2 and Angular: example, when the user navigates to another subpage, React
Firstly, Angular 2 removes template directive and controller. creates an updated virtual DOM first then compares the
It uses a new module called ‘Component’ to combine both parts difference between virtual DOM and a light-weight copy of the
[7]. original displayed DOM. This comparison ensures changing
will take place optimally (using ‘dirty checking’ or
Secondly, Angular 2 adds event binding as one-way binding ‘observable’). As a result, the website updates faster, which
from view to component which does not t in Angular 1 proves one of the best advantages of virtual DOM.
React also builds up a new standard in UI design and
development by enforcing developers to create UI components
under module standards. React recognizes its own reusable
components and avoids unnecessary re-rendering on the web
pages whenever these components display.
In addition, React uses JSX [10] as its programming
language, which is an extension to JavaScript that has XML-like
Figure 1. Event binding between View and Component [7]. syntax. This approach helps business logic and component
HTML template co-locate in one file, which in turn makes
Thirdly, Angular 2 changes its language from ‘JavaScript
Based’ to ‘TypeScript Based’, a strict syntactical JavaScript components well encapsulated and reusable in React [11].
superset developed by Microsoft [7]. Using React alone maybe not sufficient to build a complex
application. Other libraries may be needed to develop a fully
functional advanced application with capabilities such as API
B. React calls, routing, dependency management, enforcing
unidirectional flows, and testing. For instance, Redux is a
React was developed by Facebook, initially in order to library [12] that provides a single-state container that all React
enhance Facebook and Instagram applications with a better user components can access and manipulate.
experience. Due to its powerful features in rendering UI
efficiency, React was released to the public in March 2013 as an
open-source JavaScript ES6 based library [8]. Later in 2015, III. COMPARABLE CHARACTERISTICS
React Native was also launched to expand React capabilities in To systematically compare the two frameworks, there are a
the field of mobile application development [9]. few points or features that we can base on them to carry out
Most React projects were written in ES2015, which is also further analysis. This analysis will provide us a high-level
referred to as ES6. ES2015 is a pseudonym for the 2015 version overview of the selected framework as well as assist us in
of the JavaScript programming language to be approved by making a decision on what framework to follow in our
ECMA International, the standards group for vetting and application project.
approving different versions of the language.
Language: This is a critical aspect to be considered in
deciding which frameworks to use due to their efficiency, Table 1. shows the current language-based situation
popularity, and difficulty. between different frameworks.
IV. THE COMPARISION However, Two-way data binding also possesses noticeable
In this section, we will go through the defined main features drawbacks. Both model and DOM can be updated
of web development frameworks mentioned in the earlier simultaneously. The more data bindings we have, the more
section. observers and watchers will be needed which may affect the
performance of the application.
Language: React uses JavaScript ES6, the latest JavaScript
industry standard from 2015, as their based language, Using two-way to transit data between component and view
meanwhile, Angular 1 uses the JavaScript ES5 which is the may also pose a risk of conflicting data being spread from
previous version. Angular 2, however, relies on TypeScript multi-sources, which leads to unexpected component states,
which optimizes the JavaScript language structure and provides especially in event-based circumstances. This is not the case
an excellent experience of type inference which in turn reduces with one-way binding.
various types of bugs. The advent of TypeScript, with its
declarative nature [13] in Angular provides a good opportunity To avoid this situation, the Angular 2 team solves the
in object-oriented programming in the front-end. Despite the dilemma by allowing developers to use both one-way and two-
fact that TypeScript possesses certain advantages over way binding. This flexibility provides a hybrid solution to
traditional JavaScript, its developer community is still limited, leverage the advantages of both mechanisms.
which poses a potential risk that it may disappear at some point
by other future rival languages. JavaScript ES6 is however here
to stay due to its updatability and being the industry standard.
Figure. 4. Example of data binding in AngularJs
Figure. 7. Example of data binding and templating in Run memory 10.9±0.1 9.7±0.1
AngularJs (2.7) (2.6)
Unlike Angular, React puts HTML into JavaScript [15] as Community Support: Better support means a better
shown in Figure. 5 while Angular puts JS in HTML template. relationship with developer communities, which is a crucial
Instead of vaguely separating concerns by putting markup and part to make a framework popular. In this regard, React
script code in separate files, React uses loosely coupled provides consistent technical support. Facebook is a huge
“components” which includes both [jsx company that possesses a large fan base. The core team is
https://reactjs.org/docs/introducing-jsx.html]. It embraces the supporting developers all the time with bug fixes releasing and
idea of rendering logic should be inherently coupled with UI other development tools. It does a very good job of keeping its
logic from events, states handling to how data is rendered. To API stable. Official scripts are released to simplify the
achieve this, React uses JSX where any valid JavaScript development upgrade and immigration process Angular also
expression can be put inside the curly braces. After offers similar services. It is backed by Google, all the design
compilation, JSX expressions become regular JavaScript documents are shared in the community and there are various
function calls and evaluate JavaScript objects. [jsx] Besides, developer tools to support it. Protractor, Batarang, ngmin, and
ES6 added the ability to use backticks at the start and end of the Zone.js are just a few of many. Its API, however, is not as stable
string to write inline code. String interpolation using as that of React. One clear example is AngularJs (or Angular 1)
${expression} placeholders can be used as well inside is totally different compared to Angular 2 or later versions. On
templating. Figure. 8 shows the usage of backticks and string 31st December 2021, AngularJS will hit it’s EOL.
interpolation.
Recently create-react-app is a useful tool that React [2] M. Kovatsch, M. Lanter and S. Duquennoy, 2012.
community released. It automatically creates all necessary Actinium: a Restful runtime container for scriptable
Internet of Things applications, 2012 3rd IEEE
configurations to set up a new project. This speeds up new International Conference on the Internet of Things, Wuxi,
project development by reducing the time needed for 2012, pp. 135-142.
configurations. A comparable tool in Angular is Angular
Command Line Interface (CLI), which was released in March [3] Teixeira, P., 2012. Professional Node. js: Building
2017. It facilitates generating Angular components, services, JavaScript based scalable software. John Wiley & Sons.
enum, pipes, and classes which makes it easier to create a
project from scratch with all needed dependencies including the [4] K. Lei, Y. Ma and Z. Tan, "Performance Comparison and
Evaluation of Web Development Technologies in PHP,
project best practice structure (source code, environment Python, and Node.js," 2014 IEEE 17th International
variables, main and index.html, E2E testing locations). Plus, it Conference on Computational Science and Engineering
can build and deploy the project either for development or (CSE), Chengdu, China, 2014, pp. 661-668.
production aim.
[5] Github, “Front-end frameworks popularity (React, Vue
As it was the first choice for many developers, the total and Angular).” [Online]. Available:
https://gist.github.com/tkrotoff/b1caa4c3a185629299ec23
numbers of followers for React are higher than that of Angular. 4d2314e190
At the time of this writing. the total number of stars and
watchers of Angular GitHub [17] are 72.1K and 3.2K, [6] Ramos, M., Valente, M.T. and Terra, R., 2018. AngularJS
respectively. For React, those numbers are 166K and 6.7K, performance: A survey study. IEEE Software, 35(2),
respectively. pp.72-79.