Re:TypeScript: Branded Types
by antifa on Thursday April 25, 2024 @08:12AM
(#40156523)
As oppose to a zero cost build time check, that's 3 expensive runtime DB checks, plus an account and a member could have the same ID, so it might run anyways but on the wrong DB rows.
[ Parent
| on HN ]
You made two points that are correct in theory, but in practice those lookups would/could take micro-seconds, and the bug would be detected within minutes in a production environment. And it would take five minutes or less to patch.
If you're cowboy coding as a solo dev, sure.