https://pantsbuild.org/ logo
#development
Title
# development
a

aloof-angle-91616

03/12/2020, 7:57 PM
we could make it a class like
BuildFileAliases
and override the
+
or
|
operator!!!!
h

hundreds-father-404

03/12/2020, 7:58 PM
We could. It would be cool code. But, I think a big benefit of the engine is how much of it is plain and simple Python 3
UnionRule()
isn’t enough of a pain to justify a custom dict type, imo
h

hundreds-breakfast-49010

03/12/2020, 7:58 PM
I'd rather keep the data structures standard python dicts and lists (or sets), and just write a simple utility function to do the meging
a

aloof-angle-91616

03/12/2020, 7:58 PM
wrapping things in classes makes it easier for me to reason, idk if you've noticed. definitely a personal thing
h

hundreds-breakfast-49010

03/12/2020, 7:59 PM
yeah that's the classic object-oriented vs functional trade-off
a

aloof-angle-91616

03/12/2020, 7:59 PM
ehhh i don't know about that
h

hundreds-breakfast-49010

03/12/2020, 8:00 PM
you can write a class that encapsulates some specific business logic, or write a function that knows how to implement that business logic on less complicated types
a

aloof-angle-91616

03/12/2020, 8:00 PM
@dataclass
is a great example of leaning towards less stateful programming
oh
well
when i hear "object-oriented vs functional" my hackles raise up for no reason
that's a good point!
h

hundreds-breakfast-49010

03/12/2020, 8:01 PM
yeah people can definitely get ideological about those terms. I like to think about them as value-neutral descriptors of ways of thinking about code organization
a

aloof-angle-91616

03/12/2020, 8:01 PM
i just don't know how to interpret anyone's usage of them :D
💯 1