Skip to content

Instantly share code, notes, and snippets.

@k1r0s
Last active March 14, 2018 10:43
Show Gist options
  • Select an option

  • Save k1r0s/c660ecf8716fedd2b092357c092ade18 to your computer and use it in GitHub Desktop.

Select an option

Save k1r0s/c660ecf8716fedd2b092357c092ade18 to your computer and use it in GitHub Desktop.
Tiny comparison and personal opinion retrospective that I did for a company

Little background (technical): https://medium.com/javascript-scene/angular-2-vs-react-the-ultimate-dance-off-60e7dfbc379c

Benchmark resource (from vue docs): https://rawgit.com/krausest/js-framework-benchmark/master/webdriver-ts/table.html

https://twitter.com/_ericelliott/status/778744645123579904?ref_src=twsrc%5Etfw&ref_url=https%3A%2F%2Fqmenta.atlassian.net%2Fwiki%2Fspaces%2FML%2Fpages%2F380731%2FTechnologies

https://twitter.com/_ericelliott/status/782301875034923008?ref_src=twsrc%5Etfw&ref_url=https%3A%2F%2Fqmenta.atlassian.net%2Fwiki%2Fspaces%2FML%2Fpages%2F380731%2FTechnologies

My experience Facts:

Both are very fast Both rely in webpack Angular is bigger while React is smaller React encourage developers to take decisions while Angular not With React you have full control while with Angular you often loose it Angular comes with strong conventions while React not Angular community is big but React is ... ludicrously bigger React let you understand what's happening under the hood while Angular is quantum physics Angular is pretty young still while React is a oldie badass Angular teams tend to rely too much on the framework while React teams tend to fully understand Javascript My opinion (4 years working on the frontend is almost the whole frontend's history )

React is way simpler than Angular because is a library, not a framework. So building an application with React forces you to take decisions at the beginning of the process which it means that you'll not be too much productive on the firsts weeks. 

Angular is bigger and makes a lot of assumptions, because is a framework, a monolithic one. Which means Angular tries to cover all of functionalities that you will ever need. This should speed up development and often it does. But you can loose control and I see it happen many times. 

Tools drive development.

This is not mandatory, you can run an Angular project and being success, no doubt. But, why and when you need such kind of tools that avoid you to make decisions? do you have a frontend developer in your team? No? But .. do you have hands? ok, you should choose Angular.

Do you have frontend developers with you? Maybe they'll already choose React.

Selected stack Selected stack is a picking of most successful tools/strategies in JavaScript world: 

Preact - Fast 3kb React alternative with the same ES6 API. Components & Virtual DOM

TypeScript -  JavaScript superset that compiles to clean JavaScript output featuring type check

Redux - Predictable state container for JavaScript apps

Arguments: React's virtual DOM has become the most successful strategy on DOM manipulation which is the core concern in web applications. Preact is a complete rewrite of React library which features best performance http://developit.github.io/preact-perf/

Preact has grown in popularity during last year and boosted its popularity two months ago as prime alternative to React when Facebook issued to step back from open source community by changing its products license. Fortunately they changed their minds perhaps most of React alternatives are completely Open Source. Preact comes along with MIT license.

Preact is also way simpler than Facebook's React. So its easy to debug, to extend, etc. 

You always want to know who is using this: https://preactjs.com/about/we-are-using

https://twitter.com/_developit/status/922525910535847936?ref_src=twsrc%5Etfw&ref_url=https%3A%2F%2Fqmenta.atlassian.net%2Fwiki%2Fspaces%2FML%2Fpages%2F380731%2FTechnologies

5 years ago Microsoft take the right decision to develop a tool that bring modern JavaScript to its projects, even if those features were not supported by most browsers yet. As a one of the big software ones, Microsoft relies a lot on JavaScript to provide a neat experience to its customers so they spend a lot of time building rich front-end applications. Using the last JavaScript features boots productivity and readability, improves code maintenance, so that was a nice decision. And its release come with one of the best decisions ever made in software by big companies: TypeScript is completely Open Source under apache license. 

TypeScript provides a superset of JavaScript latest features and also provides a strong, modular type system which allows you to enrich your applications with strong typing which removes most of JavaScript dummy errors out of your code because it performs type check while you're coding which is handy to avoid common mistakes in JavaScript applications because of JavaScript's dynamic typing. Types also provide an "in live documentation" which is handy building large apps. Another feature is that types are completely optional so typing your app is completely optional.   

There are enough reasons to choose TypeScript among other transpilers since it provides many features that are missing on the others: https://redditblog.com/2017/06/30/why-we-chose-typescript/ 

Another feature is that TypeScript is highly configurable through tsconfig.json file and compatible with other tools like babel so you can manage to include it without running in incompatibilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment