3 ms·
I'd almost always rather have a class than a function returning a function, in a language where classes are typical and natural. It imposes more structure on th
by nerdponx 5y ago
I'd almost always rather have a class than a function returning a function, in a language where classes are typical and natural. It imposes more structure on the code, provides some degree of namespacing, and makes it easier to extend.
- gorgoiler 5y agoPersonally, classes feel particularly unnatural in Python. Closures are also weird though, I get your point. I wouldn’t use them in code that’s widely shared. The upside is truly private data.