React, Redux, Angular, JavaScript, Dart - the world of the frontend is on the verge of a full-scale war of adherents of different technologies. It is time for heroes - who will save the world in web development and become the main character of a new era?
It seems that Yevgeny Gusev, the
Wrike frontend timblide company, knows this. We managed to distract him from work and ask a few questions that are so worried about those who have already managed to try Angular 2 or have just heard about it
. Eugene told us about the benefits of Angular 2, the speed of development of the project, the difficulties and joys of switching to it. We managed to discuss React, JavaScript and Dart, in general, to compare and change all forces. However, enough teasers. Master, you have the floor!

')
- Tell us about yourself, what do you work with and how did you get into Wrike?My name is Eugene, and I write on Dart and Angular 2. Probably a strange beginning, but you need to dot the i's. I work as a front-line team in Wrike, and I started with C ++ under microcontrollers, I wrote a little on this and that, then I got to C #. When I switched to Dell, I began to communicate more closely with the front end, and in the most banal way: someone needed to write UI, but there was no one. And he started writing right away on CoffeeScript (yes, yes!). The years went by, and I moved to the company in which I now work, namely Wrike. We are developing a large SaaS platform for task management and collaboration. Now we have almost 30 front-end developers, plus a team of layout designers, and we, like Alice from a well-known fairy tale, are all growing and growing.
Wrike went quite a long way: from a very small startup to two million lines of code in 9+ years of development. Of course, during this time we have changed a bunch of frameworks and technologies. It all started with Dojo, then Ext.js. We wrote on Polymer 0.5, and when it became deprecated (with the release of version 1.0), we faced the question - what to choose? Actually about what options we had, and why we eventually chose Angular 2, I will tell you in
my report .
- Your report on the upcoming HolyJS is titled as “Angular 2: the familiar hero, new hopes”. What hope and to whom can the new version of Angular give?In short, there is an Empire (React world), and there are rebels (Angular). Once in the galaxy the rules of the republic, but then, under the pressure of superior forces, she had to retreat. And now everywhere in the world they can only hear: “React, Redux!” In the camp of Angular, a hero was needed, a new blood. And so he came.
But seriously, the person is so arranged that everyone is susceptible to HYIP and trends, and even more so in the world of the web, since it changes much more often than, for example, the backend. In Java, if the technology is less than 5 years old, this is beta. That is why twitterrocracy reigns here - the one who has more reposts rules.
Once Angular was the most fashionable, and then many people (ie companies, projects) sat on it. Of course, after the jQuery world - it was something very cool and powerful, like the Old Republic (hi to Star Wars fans). However, the years passed, Angular lagged behind, and React became the ruler of the minds. Now it is impossible to imagine any front-end conference without a topic about React or Redux and others like them.
Retreat: if you came to the conference, and it turned out to be wildly boring, then such an amusing game will help you pass the time (yes, you guessed it correctly! This is “bullshit bingo”): the players listen to the report, and as soon as the speaker says “ React ”—all drink. Loses the first one who will be taken out of the hall. Everybody drinks Redux twice. Time flies by, that’s for sure. (hello, Lesha aka
Flack )
So, Angular 1 can no longer be with competitors - the approach to development, technology has changed. We again came to fat clients with a large amount of business logic, and the requirements for response time and speed of work have not changed. On the contrary, the user says: “I have a top computer, and your site is slower than Google!” As a result, this situation develops: Angular still has a lot of fans, sometimes of its own accord, sometimes forced (legacy code). However, they must switch to React, because, of course, it is ahead of Angular 1 by a head.
And here Angular 2 comes onto the scene. React, although good, but not infallible, it has its drawbacks. For those who want alternatives, or simply loves Angular, a fresh version and can give this very “new hope”.
- Angular 2 so significantly different from the previous version? Can he compete with competitors?Yes, it has changed significantly. Yes, so that between the first and second versions there is no backward compatibility. Yes, of course, it may sound like “take everything and rewrite”, but Angular 1 is based on approaches that no longer work. Of course, first of all, this is a two-way data binding. By itself, it is not that bad, but its implementation in the first Angular significantly affects performance. And of course, no comparison with the speed of React.
Work on the bugs was done significant, the development team tried their best. I will show and tell about it in the report. We appreciated the advantages of Angular not only from “synthetic” tests and ToDo applications, but, as I said, not so long ago Wrike switched to Angular 2. So everything I’m talking about is “first hand”. Anyone can go to
www.wrike.com and try to see. For example, the speed of Angular 2, we estimated immediately. And not one, but two whole:
- The speed of the code. Here, of course, the moment worked, that when the framework was changed, the code was also cleared, but nevertheless.
- Development speed On Angular 2 it's just nice and easy to write. By the way, the documentation is very complete, and what is missing is easy to understand from the code. Here, first of all, a big plus is that Angular 2 is written in Typecript and transported to Dart. What a frequent problem in JS: you want to use some function from the library, and you understand what is not clear - and what are its arguments at all? The documentation is not written in the IDE put an end, you start to drive - you are prompted by ten functions. In a typed language with this, of course, easier.
- Is Angular 2 not yet in the beta version?In Star Wars, there is a quote: "Change cannot be avoided, as well as the sunset." You always need to change and adapt to the new way. Of course, it was a bit scary, but Angular 2 goes forward in huge jumps. More recently, they were in beta, but a release candidate is already being prepared (
https://github.com/angular/angular/milestones ).
- And how many times everything broke because of the new versions?In fact, not once. Of course, changes in the framework are constantly underway, and there are breaking changes. But, first, all development is open, therefore, about future changes are usually always known in advance. And secondly, we have a good QA + Dev team!
- Why did you choose Angular, but not the same React?As I said before, we write in Wrike on Dart. We have already
talked about the reasons and advantages of such a transition. About why for a large project JS is not very suitable, I had a
report that at one time caused quite a heated discussion.
We have the same requirements for the view framework as for the language: rich opportunities out of the box, modularity, speed, and compatibility with our ecosystem. React is good, but in my opinion it has a number of minuses:
- No entity for events. Those. components can only communicate using callbacks that pop up. ( https://gist.github.com/bunopus/18792002dd40eab33c83e0252aa955a5#file-ng2vsreact )
- No DI out of the box. Because of this, it is necessary to insert some crutches in the form of High Order Component. (There are several solutions for DI - the same redux, reactive-di).
- There is no typing at the level of the language for describing the interfaces of the components (only built through propTypes and the ability to screw Flow).
- Jsx - for which there are many opinions for and against, i.e. Whether to mix layout and code or not.
That is, in general, React can do everything, it has a lot of expansion points, outsourced to external developers, but there are not so many resources out of the box. In our case, such a plurality of solutions is not very good.
Angular 2 prohibits much, but it also gives much. For us at the moment this is an optimal tool, since it is easier to adapt (it is necessary to change only one thing, and not a separate set), it is easier to learn. And of course, a big plus is his native support for Dart.Soon
we will tell about the differences between React and Angular 2, follow the announcements.
By the way, we are not the only company with such a stack (Angular 2 + Dart). The largest advertising platform in the world uses the same technology - I'm talking about Google AdWords. Their motives are on the whole similar to ours; more details can be found here in
this article.
- Angular 2 + Dart. What projects would you recommend to choose the same bundle?To patient developers ;-). Of course, the transition to Dart and Angular 2 was not done at the click of the fingers - there was a lot of work. But here we must take into account our specifics, about it, I think, we will tell in
our blog .
If this is a new project, or are you thinking: “Wouldn’t I bang it all over again?”, Then, first of all, I would advise you to look at this particular bundle. If you highlight some formal signs that I would call these:
- Your project will need to be sustained for a long time . If you know that in half a year the project will be closed, then you can write on anything. Know JS - write to JS. Read the book "Php for the smallest" - write on it. Perl please. However, if more than one generation of developers come after you, I think they will thank you for the self-documenting code (for example, on Dart).
- Significant amount of code . This item refers us to the first. The whole question is in support. In my experience, the person who sees it for the first time can read the Dart code. It is enough to write in a C-like language (C, Java, C # etc).
- Big team. When in a team of one to three developers, social contracts work: “Let's write documentation,” “I did a function here — a line is output, and on Mondays, a map file, ok?”, “I fixed a bug there, one module commented out, I'll fix it tomorrow, don't touch it yet. ” But when there are a lot of developers, it is already impossible to agree with everyone. And if there is also a lot of code, chaos can begin. Therefore, the fewer ways you can write some logic, the better. Nobody scolds a hammer that they can not paint the walls.
- Modularity. If something from the above is about you, then you probably would like the teams to work as isolated as possible. Here Angular (however, we must pay tribute to other languages) works with a bang. Dart also helps with this.
In general, everything that I have listed is similar to a serious Enterprise (how not to treat it). This does not mean that you will not build a large and reliable application in any other way - no, of course. "Only the Sith are elevated to the absolute." However, both tools (and Angular 2 in particular) are sharpened specifically for complex client code with an abundance of logic.
Who may not be suitable: if you are a hipster, you like to pick something up in the intestines under a glass of a fresh smoothie and implement the Flux architecture in your own way (“the rest do not understand, but I see this”). No, not because I have something against hipsters, but because both Angular 2 and Dart, although they give a lot, but also prohibit a lot. There is a difference in paradigms: “Single maintainer” vs “Community”. Sometimes it happens that you yourself swear: “here it would be different”, “why do i do so idiocy”, but this is the price paid for great opportunities to start. Angular competitors, for example, the same React, have much more possibilities for customization.
- And what are the main competitors of Angular 2?Comparing different frameworks, we often compare ecosystems. I think that now the young Angular has such competitors, in descending order:
- React. Not only ecosystems collide here, but also religions in some sense. I will tell about it in the report on June 5.
- Aurelia. This is also quite a young framework, written by a native of Google, who became disillusioned with Angular 2 and decided to write his own library “with preference and courtesan”. It looks quite promising, but sometimes it seems that it was written on the basis of the principle “in spite of my mother frostbitten ears”.
- Polymer. Here, Google competes with itself. However, it is not entirely correct to compare them, yet Polymer is rather a huge library of components, rather than a complete framework.
- Oddly enough - Angular . As is always the case with the release of a new version of something, it is rather difficult to understand why switching to a new version, wasting time and effort.
To summarize, Angular 2 has a huge advantage. On the one hand, an experienced team (many participated in the development of the first version) and the knowledge base on how best to do it. On the other hand, the framework is not burdened with backward compatibility, outdated architectural solutions and so on. Thus, Angular can take all the best from other libraries and bring the world to the galaxy.
- In the course of our conversation there were a lot of references to Star Wars. May I ask you to give some recommendations to front-end developers in the style of this film saga.Well, like this ... If you paraphrase the words of Master Yoda "Pride, bias ... All this leads to the dark side of power." I would advise never to go to extremes and not to judge without knowing. Perhaps neither Dart nor Angular 2 will suit you. Perhaps this is not the fastest / convenient / trendy tools. But it's definitely worth a try. We in Wrike, in turn, are always ready to help and answer questions, come to visit our St. Petersburg office. Thank you for the interview, and "May the force be with you."