https://pantsbuild.org/ logo
#general
Title
# general
f

flat-zoo-31952

07/29/2022, 6:50 PM
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

happy-kitchen-89482

07/29/2022, 6:55 PM
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

flat-zoo-31952

07/29/2022, 6:59 PM
hmm, with parameterized targets that's definitely violated 😄
h

happy-kitchen-89482

07/29/2022, 7:06 PM
True, this was coined like 10 years ago, before any of that was a thing
But hey, rule of three!
f

flat-zoo-31952

07/29/2022, 7:10 PM
heh
b

busy-vase-39202

07/29/2022, 8:09 PM
Wasn't there someone who found a quote about 111 in a book last year? Was that maybe you @fresh-cat-90827 ...?
h

hundreds-father-404

07/29/2022, 9:07 PM
maybe we should rebrand it?
f

flat-zoo-31952

07/29/2022, 9:33 PM
Fwiw I didn't find "111" in the docs on readme
1
w

witty-crayon-22786

08/01/2022, 1:32 AM
b

busy-vase-39202

08/01/2022, 4:03 PM
Should we mention this somewhere in the docs, since "111" is out there in ether?
h

hundreds-father-404

08/01/2022, 4:12 PM
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

busy-vase-39202

08/01/2022, 4:13 PM
Josh hadn't read the book but somehow had been exposed to the term...
h

hundreds-father-404

08/01/2022, 4:14 PM
only from our Slack because the old-timers (Stu, Benjy, and me) still sometimes use it
b

busy-vase-39202

08/01/2022, 4:15 PM
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

hundreds-father-404

08/01/2022, 4:16 PM
i'd bias towards us 3 learning to stop using the phrase then
b

busy-vase-39202

08/01/2022, 4:16 PM
This is also a fair approach
h

hundreds-father-404

08/01/2022, 4:16 PM
it's not really necessary to express the idea, and none of us know what the third
:1
is lol
🤣 1
f

flat-zoo-31952

08/02/2022, 12:21 PM
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

curved-television-6568

05/15/2023, 7:02 PM
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

hundreds-father-404

05/15/2023, 7:11 PM
Ah, one target, one directory, one package
👍🏻 1
f

flat-zoo-31952

05/15/2023, 8:20 PM
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
4 Views