3 ms·
> I know what a UUID (or a String) is. I don't know what an AccountID, UserID, etc. is. Now I need to know what those are (and how to make them, etc. as well) t
by petesergeant 1y ago
> I know what a UUID (or a String) is. I don't know what an AccountID, UserID, etc. is. Now I need to know what those are (and how to make them, etc. as well) to use your software.
Yes, that’s exactly the point. If you don’t know how to acquire an AccountID you shouldn’t just be passing a random string or UUID into a function that accepts an AccountID hoping it’ll work, you should have acquired it from a source that gives out AccountIDs!
- recursivedoubts 1y agoAnd that's my point: I'm usually getting AccountIDs from strings (passed in via HTTP requests) so the whole thing becomes a pointless exercise.
- petesergeant 1y agoDo you validate them? I assume you do. Feels like a great time to cast them too
- Kranar 1y agoYou just accept raw strings without doing any kind of validation? The step that performs validation should encode that step in the form of a type.
- recursivedoubts 1y agoi pride myself in never doing any validation ever never escape anything, either just hand my users a raw SQL connection
- thfuran 1y agoI prefer to just skip a few steps and email them my bank account number when they register an account.
- lmm 1y agoIf your system is full of stringly typed network interfaces then yes there is no point in trying to make it good. You can make things a bit better by using a structured RPC protocol like gRPC, but the only real solution is to not do that.