there’s problem with branded types this way now that i think of it
string
type nonEmptyStr = string & NonEmpty
type ipv4Str = string & IPv4
it’s not obvious how you’d automatically determine ipv4Str is also a nonEmptyStr, since the types themselves are just labels, they don’t store the refinements at type level
i see these rules and think “70 lines wow that’s short”
and then i read code and see a 50 line function and am like “wow this function is doing a lot”
sure strict rules aren’t amazing, but i think it would be cool to have a linter warning when there are more than X functions with over 70 lines (this is language dependent - verbosity)
while this is nice, the type itself doesn't encode the logic (unlike refinement type)
i think this would be really nice if validation libraries like zod returned branded types when they are validating non-comp-time types (like z.ipv4() should return some IPv4 branded type)
css is primed for this since you can write your rules in such a way that rule order doesn't matter, which means you really don't have to think about where your code it
in my dream world, i have very smart search (probably llms will help), i look at just the minimal amount of code (ideally on a canvas), edit it and remove it from my context
i don't care where or how the code is stored, let the editor figure it out and just give me really good search and debuggers
by far the most helpful realization i had in the last decade was that i have severe limitations, and i have to give up constantly until i find the path of least resistance
i want better, declarative, interactive, fast UIs
CSS is the best answer we have