USA/UK English

What is a framework and when to use it?

.

Hello everybody, How are you? Today, we are going to talk about a somewhat important topic when we talk about development. The tools that make the development of complex systems too easy, but sometimes end up placing great complexity on what we need to develop, let’s talk about frameworks.

Ruby on rails, Vue and Angular on JavaScript Front-end, Express on Node.js, Phoenix on Elixir, Laravel and Symfony on PHP, Spring Boot on Java, among others. With the idea of ​​developing as quickly as possible, nowadays too much is demanded of developer person that she knows a framework to facilitate the development of complex systems. But, should we use framework in everything we develop as a dev?

What is library?

First, for those who are still starting their development studies, it is important to define what a framework is. But for that, we first need to define what a library is.

A library is a set of functions, classes or any other type of code developed to abstract (facilitate) the resolution of a specific problem under development, provided that this code is not within the programming language itself (in the core of the language) used.

For example, in PHP we have the DateTime class to manipulate dates and times, this class is not a library, as it is a native language class. However, there is a feature set called Carbon, which also works with dates and even inherits the DateTime class, as Carbon does not belong to the core of the PHP language and solves a specific problem: handling dates, Carbon is a library.

What is framework?

And now knowing what a library is, what is a framework? Framework is a set of libraries that talk to each other capable of abstracting the development of an application (in the context of its use) from end to end. That is, using Ruby on Rails, Laravel or Sprint Boot, for example, devs can develop the back-end of an end-to-end application: development and consumption of APIs, manipulation of files, security layer management, user authentication, request management, session management, among other things; in the same way that using Angular, for example, devs can develop the front-end of an application from end to end.

Understanding this, it seems wonderful that we use frameworks for everything we develop, right? since these library sets provide a facility for us to develop an end-to-end application. It’s a little bit more complex than that.

what is framework library

When to use frameworks?

Use frameworks under development it is an important step for a developer person. Some things that are difficult to implement and end up demanding a lot of development time are easily available in frameworks. For example, the database libraries used in the frameworks already implement solutions that avoid SQL injection, do API requests external interfaces are usually quite simple when using frameworks, in some cases frameworks are even capable of generating most of the screens in our applications.

Frameworks are used and developed by many dev people, so they are code widely tested and reviewed by the community, increasing the reliability of developed systems. Security issues are also very focused by those who develop, most of the common application security problems are already solved when we use a framework.

In addition, using a framework, the developer ends up acquiring the knack of developing in that framework. As I said earlier: the libraries within a framework talk to each other, and in general the type of conversation is very rigid, making the developer person end up being hostage to the way of writing using a framework.

In each framework, for example, it is used types of design patterns, specific code writing and componentization, which sometimes makes each person adapt to a specific framework. This coupling ends up making it difficult to change frameworks in a project after being chosen.

But if frameworks are so good, should I start programming by learning a framework straight away?

For a beginner in development, a framework abstracts the layers of development a lot, however, it is important for a person who is starting to first understand how the language works as a whole. What you can do with it natively, how functions within the language are used.

It is important for those who are starting to understand how everything works under the cloth, even to be able to deal with errors and adjustments that must be made at the language level within a framework. In the end, frameworks remain a library set of a specific language, so the more you know about the language, the easier it is for you to adapt to the various frameworks of that language.

Therefore, ideally, a person who is starting in development develop some projects using the pure language and its native functionalities and then go to the frameworks, to understand what is abstracted in the frameworks and how the same problem can be solved in different ways in development.

As I said before, after a project starts in a framework, it is unlikely to be redone in another framework, moreover, in some companies there are projects in several of them. It’s interesting for beginners understand the language in depth to really facilitate the understanding of what is being written in a specific framework, but with the tranquility of being able to experiment and not just stay in a framework.

With the anxiety of the people in enter the development area and not stopping to study the bases and languages, we end up having a lot of what we call framework devs. A person who develops applications without understanding how they work under the hood, just using a single framework. That is, if the person has to do something using the native language or another framework, he is not able to solve these problems, since he is conditioned to only that development process and with that specific framework.

I hope you enjoyed today’s article, thanks for following the blog here.

To the next!

.

Mostrar mais

Artigos relacionados

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *

Botão Voltar ao topo