3 ms·
And if I have many single-use functions in a module? I call them _f1(), _f2(), _f3() etc? Naming things is a burden, one of the two hardest computer science pr
by dTal 6y ago
And if I have many single-use functions in a module? I call them _f1(), _f2(), _f3() etc?
Naming things is a burden, one of the two hardest computer science problems. Mandating that all functions be named is like mandating that all values be named - no "x * 2" for you! You have to do "doubling_constant = 2: x * doubling_constant". It's true that beyond a certain level of complexity, a name can help convey intent - but that's a decision best left to the programmer, not enforced by some stupid arbitrary parsing rule.
- travisjungroth 6y agoCall them all _f. If you have a linter it may need tweaking.
- powersnail 6y agoYou don't have to define them in a module. Just define them on the spot, like a lambda. So all of them can be named `f` without a problem.