|
|
|
|
|
by Peaker
5169 days ago
|
|
This problem is indeed less severe when the names are defined in a non-local namespace (inside a class, or as globals). But callback-style often appeals to defining very-local callback code. In fact, it would be anonymous in languages that support it, but it is forced to not only be given a name, but also potentially clutter some namespace (or be written in reverse order). Consider having every for/while loop, or every "if" require giving a name to the code block[s] within it. It sounds insane. The same doesn't sound insane for library functions, but in my opinion that's really just because everybody's used to this limitation. When I moved from Python to Haskell, one of the many joys was that I could stick an anonymous code block anywhere so easily. |
|