5 ms·
Well, there is one subtle, possible advantage and that is literally just the logical grouping of code, not really encapsulation in the technical sense. Second,
by jariel 6y ago
Well, there is one subtle, possible advantage and that is literally just the logical grouping of code, not really encapsulation in the technical sense.
Second, if you have a handful of functions like this, even remotely related ... they make a nice 'Library' and frankly there is nothing wrong with that.
As I see it, I don't think it's an anti-pattern depending on how it's used.
In some other instances, first-class functions or lambdas may be just as appropriate.