.tips
page 9 of 10, 238 small things in all. back to the first.
.january
2026, 10 tips.
queueMicrotask runs before the next paint, setTimeout after it
javascriptconst type parameters keep literal types without as const
typescriptValidate once at the edge, then trust the types
typescriptvalidationusing disposes the resource when the block ends
typescriptSet has union and difference now
javascriptObject.groupBy replaces the reduce you keep writing
javascriptIntl formats numbers and dates, so do not hand-roll it
javascripti18nstructuredClone, not JSON.parse(JSON.stringify())
javascriptallSettled when one failure should not sink the rest
javascriptfetch has no timeout, so AbortController is the timeout
javascripthttp
.december
2025, 15 tips.
Keep the original error in cause when you wrap it
typescriptdebuggingexactOptionalPropertyTypes makes undefined explicit
typescriptType your routes with template literal types
typescriptBrand your ids so a UserId cannot be an OrderId
typescriptimport type for things that are only types
typescriptbuildTurn on noUncheckedIndexedAccess
typescriptA discriminated union, not a bag of optional fields
typescriptunknown at the boundary, never any
typescriptpg_dump with --format=custom, always
postgresqloperationsA lookup table beats an enum the day the list changes
postgresqlschema-designLATERAL for the top N per parent
postgresqlDISTINCT ON is the latest-row-per-group query
postgresqlCOPY, not a loop of INSERTs
postgresqlperformancetext, not varchar(255)
postgresqlschema-designStore time as timestamptz, never timestamp
postgresqlschema-design