|
|
|
|
|
by jerf
6138 days ago
|
|
Third example: Writing a Python-style generator in a language that doesn't have it. There's a trivial rewrite using gotos that means you mostly get the same logic, but you need goto. I think I've used that twice in 10 years, but when you need it, you need it. At the cost of uglying up one function you can clean up tens or hundreds of invocation points, each of which involves duplicate (and hard-to-factor-out without-this-trick) logic. (This is the trick to factoring it out.) I'll pay that gladly. |
|