📜 ⬆️ ⬇️

Path to React

In VoxImplant, we use React.js and TypeScript for all new frontend projects. But we try not to dwell on the selected tools and carefully look around - whether the eagle is flying, if the snake is crawling, if something else interesting has happened to other frameworks. Recently, we came across an article whose author in detail and thoughtfully compares React with Ember. And, yes, he has a lot of experience with both the first and the second (and not as it usually happens). We offer you an adapted, and, we hope, easy to read, translation.

On January 3, 2016, Dan Abramov posted a tweet:

“I want more React programmers to create something in 2016 using Angular, Ember, Cycle. And programmers Angular, Ember, Cycle - on React. Together we will learn more. ”

Following this call, I will share my experience with React. But before doing this, I will describe my first experience in front-end development.
')
It was something like this:


In the fight against documentation Angular

The first independent front-end application I made for the school project. He made it with Angular, and the application was not outstanding. I literally stumbled across the library. The documentation seemed difficult for me to follow, and therefore the learning process overwhelmed me. It all ended with the fact that I made the application, but it did not have routes. Therefore, by and large, it was useless. In defense of Angular, I can say that at that time I was still completely green and could not appreciate whether the documentation was good or bad for Angular 2.

After a bad experience, I began to look for other options and decided to try Ember.


My reaction to the Ember documentation

Studying Ember has the same difficulty as learning anything at all. But compared to Angular, it was easier to learn. I do not claim that Ember is lighter than Angular, and Angular is heavier than Ember. But I’ll emphasize what I really love in the Ember community: attention to documentation. The way the community maintains documentation makes it easy to get familiar with Ember. From my point of view, the study of Ember means the study of agreements adopted in this framework. Ember applies a convention over configuration.

The framework provides the developer with:

As you can see, there are a lot of extra "buns" in the Ember toolbox. It will take time to understand how this all works. But after you have mastered this science, you immediately become very productive. You easily start a project or join it, because you know what lies where.

But sometimes ready-made tools do not go to any comparison with the application's own architecture.


Development with React

React.js is a library, not a framework. Obviously, it does not provide the developer with the capabilities that Ember has. Ember gives you a home, and React gives you the tools to build a house. Or a tower. Or a spaceship. But this is not my case. Coming from Ember, where everything is ready, at first it is difficult to understand what and how to use in React - especially in terms of setting up the toolchain. Many people who learn to work with React feel tired and, in a sense, lost.

After you configure everything yourself, learn in the process what and where to use - this will be a valuable lesson for you as a developer. It is useful to learn how to use Webpack and loaders, how to set up dev servers or run tests, for example Karma, with a testing framework, for example, Mocha. I am sure that the knowledge that I gained can help me in the future, and I will appreciate all the work that is being done in Ember.

Self-tuning of everything may look something like this:



But it's worth it!

It’s pretty easy to learn how to work with React. In recent years, React has influenced many JavaScript frameworks. Ember is no exception. He adopted the “components first” approach, a very simple lifecycle, a system of “actions up, data down,” and more.

Creating a project with React also pushed me to some degree towards functional programming through Redux and some React tools. I also want to note that both React and Redux have superbly compiled documentation. I guess this is important for the learning process.

After I learned and used Ember with React, I cannot say that one framework is better than another. Both represent different approaches to solving the same problems. And besides, they represent a different philosophy of creating software. I think that instead of choosing which side to stand on (as if it were a war), we should pay tribute to the hard work that underlies the creation of any software with open source code - which we use, with whose help we learn and, if we can, kontribytim.

In the end, the framework or library we choose will be determined by the term, the current problem and, probably, the development manager. Cool apps can be made with Ember.js and React.js . Both ecosystems are great.

PS JSX is not so bad.

Source: https://habr.com/ru/post/305756/


All Articles