Post #3691090
2026-07-09 09:38 UTC
Replies (1)
-
@talios@mastodon.nz 2026-07-09 09:47
@yakmoose@cloudisland.nz Multiple ways - one thing I liked about DamnHandly is that UriTemplate.fromTemplate() parsed/validated the template into a UriTemplate class, so you could have fast fail of constants (say in a library package, separate from usage). Whereas stdtemplate just takes a string, and returns a string - so leaves it all to run time. Sure, I could solve that just adding templates for every uritemplate as a String constant, but if the typesystem could that for me - win! Tradeoffs I guess. This does keep the API the same between its Go, Java, PHP, Python, Ruby, Rust, Swift, TypeScript versions. It’s part of there design - no reason I couldn't provide my own UriTemplate class that wraps it (also part of there design system): * no language idiomatic API, only 1 low level primitive - we do encourage language-specific wrapper/alternative libraries