Closed kishankarun closed 1 month ago
Can the singleton be named builder
similar to the class name Builder
itself?
Could you please let me know why did you chose t
as the name?
The reason I choose one letter is that it's used to populate all kinds of things in populate()
. Eg,
def populate(self):
t.h1('Hello!')
with t.ul():
t.li('List item 1')
t.li('List item 2')
t.li('List item 3')
is a lot less verbose than:
def populate(self):
builder.h1('Hello!')
with builder.ul():
builder.li('List item 1')
builder.li('List item 2')
builder.li('List item 3')
⬆️ Way too much typing.
Makes sense, but I was thinking from an IDE perspective (like VSCode), where most code would be copy-pasted or done much faster with other shortcuts?
I'm still just inclined to think that brevity and readability are best. If you want to use builder
on your own projects, you could alias it like this:
from puepy.core import t as builder
But for the main project docs, tutorials, etc, I think a canonical t.
makes the most sense. It's small, readable, avoids conflicts, etc.
Rename t to builder