Answer the question
In order to leave comments, you need to log in
Planning and optimizing early or redoing later?
Perhaps the situation below is not related to the lack of premature optimization.
There is a web application, the client part of which sends asynchronous HTTP GET and POST requests in the background to the server to receive any data. Suppose these HTTP requests are sent by the
http.get and http.post functions . There are many places in the code that require receiving data via HTTP on the client. For example: getAccounts, getStatistics, getUsers, etc. For each HTTP, a function is made:
function getAccounts() {
return http.get("SERVER-URL/get-accounts") // ......запрос на сервер
}
function getAccounts() {
return http.get("SERVER-URL/get-accounts?special=1") // ......запрос на сервер
}
Answer the question
In order to leave comments, you need to log in
There is an opinion that when working through a library that can be updated and changed, you should always use a facade. In addition, the facade makes it possible to simplify some of the points required by the library.
In the development process, everything depends on the deadlines and requirements. In our office, it is promoted that we do what is set in the task, without adding a lot of superfluous. The need will change, the code will change. Or maybe tomorrow you will have to completely rewrite the entire section of the site, because it does not bring the necessary conversion.
So, if you have time for serious planning, do it, but you still won't save yourself from some situations that you didn't foresee at the time of planning. At best, save yourself from something global, IF the right choice was made at the planning stage.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question