Imagine that the project has a class through which work with the database is performed throughout the project, i.e. all models inherit it. And in order to make the code "pseudo-asynchronous", to get rid of unnecessary callbacks, there is an option to use yield . But the question is how correct it is, from all points of view, incl. and in terms of performance?

For example, how much better or worse to do this:

 let row = yield data.getRowById(id); //обращение к БД 

than so:

 data.getRowById(id,(data) =>{ let row = data; }); 

Well, it's one thing to use somewhere in one place, and another to use it everywhere in a project where it is possible instead of callbacks. Will I face something bad?

Closed due to the fact that it is necessary to reformulate the question so that it was possible to give an objectively correct answer by the participants aleksandr barakin , Streletz , D-side , Grundy , Nick Volynkin Jun 3 '16 at 6:29 .

The question gives rise to endless debates and discussions based not on knowledge, but on opinions. To get an answer, rephrase your question so that it can be given an unambiguously correct answer, or delete the question altogether. If the question can be reformulated according to the rules set out in the certificate , edit it .

    0