类型与数据建模
Annotation or satisfies for a config object
For config objects I've mostly moved from const config: Config = {...} to {...} satisfies Config. With the annotation, config…
Does an empty palette need its own case?
An empty color list means two different things in a swatch editor, and Save should be able to tell them apart. Color validity…
Is a read-only List<Int> a snapshot?
List<Int> is a read-only view, not a snapshot. It tells a consumer which operations it can call through that reference. It pr…
Validating JSON before the discriminated union
A type assertion only tells the compiler what to believe. An external response starts as bytes and says nothing about its var…
An empty cell equals zero and the empty string
Inherited a macro that flags order rows with a zero quantity, and it flagged every blank row too. The check was If ws.Cells(r…
Units of measure as cheap ids
For integer ids I've been trying units of measure instead of single-case unions, and I'd like a second opinion before it spre…
A helper ported from Java picks a different overload in Groovy
Moved a Java helper class into Groovy on the build script side, and the same call went to a different method. Laid out in ord…
Result reports a failed check, opaque proves one ran
Everyone praises Gleam for errors as values, and fair enough, Result is lovely. But for data modeling the feature I lean on h…