top | item 34223331

(no title)

exelib | 3 years ago

Not sure I agree with the author. It took me less than 3 seconds to understand the initial code, but at least 10 seconds to understand the final result, even I had the knowledge of the initial function. But in some context this pattern can make a perfectly sense. Just not in this example.

Furthermore, from my point of view, creating an anonymous function and then store it in a variable is a bigger code smell.

discuss

order

No comments yet.