Hacker News new | ask | show | jobs
by drdexebtjl 20 days ago
“I intended this to be an integer but it could really be anything” is not very useful.
1 comments

Sure it is. If you encounter something that’s not an int, that could be a signal you have a bug in your writers. Or in the source of the data. That’s useful information compared to “oh, I have some ints and some strings, that’s ANY, everything is ok.”
> If you encounter something that’s not an int, that could be a signal you have a bug in your writers

Which, is something you could have caught before it got written at all if you had your db enforcing your types.

i have no idea why this would be preferable to failing immediately on write