QQ: In Slack people refer to the practice of havin...
# general
f
QQ: In Slack people refer to the practice of having one BUILD file per directory as "111". What does the 3rd "1" represent? I assume the first two are "1 BUILD file:1 directory" but I don't know what is implied by the last 1.
h
I think I coined the phrase 111 back in the day at Foursquare, and to be honest I don't remember...
I think it was that every source file belongs to one target
f
hmm, with parameterized targets that's definitely violated 😄
h
True, this was coined like 10 years ago, before any of that was a thing
But hey, rule of three!
f
heh
b
Wasn't there someone who found a quote about 111 in a book last year? Was that maybe you @fresh-cat-90827 ...?
h
maybe we should rebrand it?
f
Fwiw I didn't find "111" in the docs on readme
1
w
b
Should we mention this somewhere in the docs, since "111" is out there in ether?
h
I don't think so -- I doubt our everyday users are reading this book hah. We already have so many concepts to learn, no need for new jargon
b
Josh hadn't read the book but somehow had been exposed to the term...
h
only from our Slack because the old-timers (Stu, Benjy, and me) still sometimes use it
b
If it's going to continue to come up, it'd be good to have it defined somewhere where Slack observers can find it. Otherwise it feels like exclusionary jargon.
h
i'd bias towards us 3 learning to stop using the phrase then
b
This is also a fair approach
h
it's not really necessary to express the idea, and none of us know what the third
:1
is lol
🤣 1
f
According to that book, the third one is 1 target, which is definitely not a recommendation these days (at least not for python)
single package, target, build file
I think "1:1 BUILD file–directory relationship" is clear enough
👍 2
c
I found it in the old v1 docs! 😛
Many programming languages (E.g., Java, Python, Go) have a concept of a package, usually corresponding to a single filesystem directory. It turns out that this is often the appropriate level of granularity for targets. The idiom of having one target per directory, representing a single package, is sometimes referred to as the 111 rule. It’s by no means required, but has proven in practice to be a good rule of thumb. And of course there are always exceptions.
https://v1.pantsbuild.org/build_files.html
h
Ah, one target, one directory, one package
👍🏻 1
f
I've long hated that use of the term "package", but that does make sense in light of how Java and Python use that word