4 ms·
There is no big harm in giving something a name. Giving a name also helps if you find a need to reuse it later. Plus a name can give a hint to what this code is
by CaptSolo 17y ago
There is no big harm in giving something a name. Giving a name also helps if you find a need to reuse it later. Plus a name can give a hint to what this code is for.
- rw 17y agoYet, if you look in functional programming code (e.g. Haskell, Scheme), you'll find many anonymous lambdas (that in python would be > 1 line). Why would good coders bother doing that?
- eru 17y agoIf something is small and enough to be anonymous, it's usually simply enough to be expressed without binding a variable. (See point-free style.)