I'm not sure I'd take design advice from someone who thought attr.ib and attr.s were a good idea. On the other hand he points out that DDD is a vacuous cult, which is true.
I’d call out patternitis and over-OOPification way before I’d criticize DDD. Yes, the latter can go too far, but the two former cases are abused on a much more frequent basis. Happily the pattern crazyness has died down a lot though.
that's a reference to my attrs library which is what data classes are based on. It originally used
@attr.s
class C:
x = attr.ib()
as its main api (with `attr.attrs` and `attr.attrib` as serious business aliases so you didn't have to use it).
That API was always polarizing, some loved it, some hated it.
I will point out though, that it predates type hints and it was an effective way to declare classes with little "syntax noise" which made it easy to write but also easy to read, because you used the import name as part of the APIs.
switchbak|9 months ago
wilkystyle|9 months ago
Can you elaborate?
hynek|9 months ago
That API was always polarizing, some loved it, some hated it.
I will point out though, that it predates type hints and it was an effective way to declare classes with little "syntax noise" which made it easy to write but also easy to read, because you used the import name as part of the APIs.
Here is more context: https://www.attrs.org/en/stable/names.html
I REGRET NOTHING
skydhash|9 months ago