React vs Angular
Tags: webdev, react, javascript, programming
Published: 2022-11-10 15:07:12


## **What is React?**
  

> React is a free open-source Javascript library.

but, the question arises that **what it is used for?**

>It's used for building influencive web applications quickly and efficiently with significantly less code than you would do with JavaScript. 

## library vs Framework

> _**library** _

**definition**

- library simply refers to a collection of code that is reused repeatedly.

**simplify your work**

- It contains a set of functions and classes that programmers can use to simplify their work.

**To speed up the process**

- It speeds up the development process.

**To solve a particular problem**

- Codes in libraries are written for a particular program or to solve a specific development problem.

**Requirement**

- You may use the library wherever you feel required in your code.

**Replace**

- It is easy to replace a library with another library.

**Benefits**

- Good code quality, reusability, enhanced speed and performance of the program, etc.

**Examples**

- React JS, etc.

> _**Framework** _

**definition**

-  A framework is like the foundation upon which developers build applications for specific platforms.

**simplify your work**

- Frameworks consist of a lot of APIs, compilers, toolsets,  libraries, etc.


**Modify the code**

- Frameworks do not allow users to modify their codes.

**Requirement**

- you can only call and use what belongs to a Framework within the same Framework. 

**Replace**

- Frameworks are difficult to replace.

**Benefits**

- Faster programming, support from the community, etc.

**Examples**

- Spring, NodeJS, AngularJS, Vue JS, etc.

## Angular vs React

> ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apprk3lmm7g6h1iocdnn.png)

##  Dom vs Virtual dom


> **Dom**


- DOM manipulation is very expensive 

- There is too much memory wastage 

- It updates Slow

- It can directly update HTML

- Creates a new DOM if the element updates

- It allows us to directly target any specific
node (HTML element)

- It represents the Ul of your application

> **Virtual dom**

- DOM manipulation is very easy 

- No memory wastage 

- It updates fast

- It can’t update HTML directly 

- Update the JSX if the element update 

- It can produce about 200,000 Virtual DOM
Nodes / Second

- It is only a virtual representation of the DOM


## Oneway Data Binding vs Two way Data Binding

> Oneway Data Binding

- In one-way binding, the flow is one-directional

- This means that the flow of code is from ts file to  Html file

- In order to achieve one-way binding, we used the property binding concept in Angular

> Twoway Data Binding

- In a two-way binding, the flow is two-directional

- This means that the flow of code is from ts file to Html file as well as from Html file to ts file

- In order to achieve a two-way binding, we will use ngModel or banana in a box syntax

## Spa vs Mpa

> Spa

A single-page application is a more modern approach to app development. It was used by Google, Facebook, Twitter, etc. A SPA is an app that works inside a browser and does not require page reloading during use.

> Mpa

A multiple-page application is considered a more classical approach to app development. The multi-page design pattern requires a page reload every time the content changes. It’s a preferred option for large companies with extensive product portfolios, such as e-commerce businesses.