1) Agreed. I'd never want to see this technique in my programs.
2) What stops you from giving it a name?
3) Putting code inline is presumably a conscious decision not to extract it into a wider scope.
4) How's it hard to decorate? For mocking and dynamically replacing, again, that goes for any inline code. Objections 3 and 4 have to argue against functions appearing in non-global scopes in general.
1) Agreed. I'd never want to see this technique in my programs.
2) What stops you from giving it a name?
3) Putting code inline is presumably a conscious decision not to extract it into a wider scope.
4) How's it hard to decorate? For mocking and dynamically replacing, again, that goes for any inline code. Objections 3 and 4 have to argue against functions appearing in non-global scopes in general.