Comment by marcodiego
Comment by marcodiego 8 days ago
Never used it, but I follow wg14, ISO's workgroup that maintains the C programming language specification. From there, it looks like defer is one of the most important improvements since the go programming language and I've seen a good number of examples were it prevents mistakes, makes the code more readable and avoids use of goto.
I can only hope it 'infects' other languages.
But Go's defer operates at function scope, which strikes me as the same kind of unfortunate mistake as JavaScript's "var" hoisting.
What we want everywhere is block-scoped defer, right?