Smart devices, such as phones, tablets or watches have changed the trend of content presentation in the direction of the API. Vendors need more flexible development tools. One such solution was the Backbone library, which contains all the necessary tools supported by the API.
Backbone is not able to create an application by itself, but a unique feature is that it can be the basis of development. That is why some programmers call it a framework like Node.js
, although Backbone is not.
Subtleties of working with Backbone
Writing quality code is not easy, regardless of the programming tool. Backbone does not tie the hands of the developer. But often this is a negative factor, because it may not choose the best way to write code, driving itself into a dead end.
Over the years, our team finds many subtleties of working with different web development tools. Often they deviate from the instructions but lead to a more tangible result. We want to share with you with some of them.
Event Bus Abuse. This library helps to connect the elements of the application with a single message bus, making them independent of each other. Often this simplifies the code and speeds up development.
But sometimes the use of additional tools more clogs the process of work, rather than simplifies it. For example, two views can provide so much data that instead of using the Event Bus, it is easier to solve a problem at the project level by specifying the responsible areas for each view.
It is also worth understanding that each created event is subject to management. If you create too many events, with the thought of facilitating the writing of code, it will be much more difficult to control each process later.
Reinventing the wheel. Repeatedly, we received application optimization tasks. Very often it happened that the previous developer tried to realize his vision in solving some problem, instead of using ready-made tools.
We are not experimenting with custom-made applications
, as experiments require time testing. Backbone is a small library with a large community. That's why the network has enough solutions for all sorts of problems.
Why do you need a development team
When we get applications for optimization, the first thing that interests us after the requirements is the previous developer. After all, it is possible to understand the approaches that were used in the development, and therefore the update will be much faster. It often turns out that the previous developer was a freelancer and contact with him was lost.
However, professionals are needed not only for this reason. Freelancers rely only on themselves, they do not have a mentor. As a result, errors may be made that the inexperienced developer does not realize.
Ignoring the functionality
Backbone is a library, but with all its capabilities it can play the role of a framework (with Underscore.js). This tool provides the necessary minimum to create a structure that will provide greater benefits. The obvious advantage of Backbone is its extensibility and many plugins. With their full use, you can create amazing and reliable applications. Underestimation of the cost of rendering
Backbone makes it easy and frequent to visualize the DOM. Abuse of this feature causes the developer to lose sight of the effect of rendering on the overall performance of the web application.
At first, the decline seems insignificant, since current web browsers in some way become pieces of software, improving performance. But as the web application evolves and data grows, the decrease in productivity becomes more noticeable.
An experienced developer understands the impact of constant event rendering. Instead of rendering each model added, it includes rendering for a package of models. This does not worsen the quality of visualization, but it helps to better evaluate the performance and make the necessary changes.
Creating monolithic species
Backbone provides incredible flexibility in creating minimalistic presentations. Obviously, this is a more laborious process, since you need to write more lines of code. Therefore, some developers create monolithic representations in which they try to work through everything that an application should do.
Such code can be effective, but detailed views are much easier to maintain and extend. Monolithic representations will require an almost complete transcription when updating, which means that the application cannot function during the scaling period.
We do not say that freelancers do their job badly. But our experience has shown that applications created by professionals have fewer errors. The Merehead team has extensive experience working with Backbone and is familiar with all the solutions that the community has provided. Therefore, we can guarantee highly scalable and high-performance applications.