Desenvolvimento de Software · Avançado · Inglês · Informal
callback hell
Código com callbacks aninhados em vários níveis, que forma uma pirâmide difícil de ler, de tratar erros e de manter.
Onde usar
'Isso virou callback hell', 'refatora para async/await'. Típico de JavaScript antigo.
Exemplos
This file is callback hell, seven levels of nesting.
Esse arquivo é um callback hell, sete níveis de aninhamento.
We rewrote the callback hell with async/await.
Reescrevemos o callback hell com async/await.
Promises were invented partly to escape callback hell.
As promises surgiram em parte para fugir do callback hell.
Cuidado
Callbacks em si não são o problema, e sim o aninhamento; promises e async/await ajudam a achatar o código.
Sinônimos
pyramid of doom, inferno de callbacks