Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And that's my point: I'm usually getting AccountIDs from strings (passed in via HTTP requests) so the whole thing becomes a pointless exercise.


You 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.


i pride myself in never doing any validation ever

never escape anything, either

just hand my users a raw SQL connection


I prefer to just skip a few steps and email them my bank account number when they register an account.


Do you validate them? I assume you do. Feels like a great time to cast them too


'Parse, Don't Validate'



Validating and then casting to a type sounds an awful lot like parsing.


If 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: