How to develop a good web application and avoid mistakes

monitor

Web applications are steadily gaining in popularity and are largely replacing classic applications. Their high flexibility, wide choice of programming languages, and independence from the client operating system easily explain this success. The very idea of client-server applications, being already very mature, has once again captured the software world.

So how to write such an application correctly? Of course, there is no single, let alone the correct answer to this question. Different organizations, groups and individual programmers tend to their own methods and approaches that meet their requirements and preferences. In addition, there are established for one reason or another and widely used solutions that, one way or another, cope with the tasks at hand.

It is no secret that when writing a web application, in addition to the obvious implementation of the required functionality, it is necessary to achieve maximum efficiency. Of course, for modest private projects this is not particularly important, but for large commercial projects it is vital. Let’s look deeper.

The term “efficiency” is rather broad in itself, but in our context we’ll define it as follows: the faster the functions of an application are executed and the less hardware resources they consume, the more efficient the application is. This is the context in which to make the right choice of tools for building a web application.

In each individual case this choice should be made taking into account the specifics of the task, but we can highlight some general recommendations which we came to after a fairly extensive experience with the generally accepted pattern.

So, it is well known that the most important stage in the creation of any software is designing its architecture. Here all the requirements and peculiarities are taken into consideration and strategic decisions are made. When the general structure of the application is defined, we can talk about the choice of approach to its implementation, the necessity of control mechanisms integration, the possibility of expansion and scaling.

Speaking about control and testability, you should remember a popular truth that the ability to check an application’s work in different conditions and with a different data set is invaluable and not always attainable. Nevertheless, various logs and alerting mechanisms, that are triggered by certain conditions, can significantly simplify testing and debugging.

However, the most unexpected recommendation would probably be to avoid any third-party libraries and frameworks whenever possible. This applies to both the client side of the application and the server side. The application should be as compact as possible and consume as few resources as possible. For example, using the very popular jQuery library (or similar) significantly slows down the client side and requires a lot of resources, which is completely unnecessary. You can write absolutely everything you need in JavaScript and the faster loading and working of the client part will be highly appreciated by the client.

The same applies to the server side, and especially the construction of the API for the interaction between them. Using established CGI or WebSocket protocols is sufficient for this purpose where needed. Different frameworks like ORM somewhat ease the work of the programmer at the cost of reducing the efficiency of the application, and even add to the dependence on these libraries and bring to the system all their shortcomings.

It is much more effective to write all the necessary services yourself in the chosen language. This will drastically improve the efficiency of the system, because it will not contain unnecessary code, and the code written specifically to implement specific functionality will run much more efficiently than the general purpose code.

Yes, writing an application on these principles is more complicated and often takes longer than when using general purpose libraries, but it is written once and will last for years. It makes sense for us to build customized applications (like tailoring a suit). This is the approach that allows us to create fast, reliable, efficient applications which, with the right level of performance, will greatly outperform general-purpose systems.

Jones Kenneth

Learn More →