Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
codedokode
· 3y ago · 0 comments
I don't understand why in Rust integers wrap around. It doesn't make sense and there are vulnerabilities caused by wrapping integers in C.
Comments
[–]
sdfghswe
3y ago
What's the alternative? What would you expect happens?
[–]
codedokode
OP
3y ago
Panic so that the invalid value doesn't get stored into the database or somewhere else. The developer then would notice the problem and fix it.
Silently using invalid value is the worst choice.
[–]
sdfghswe
3y ago
Pardon my ignorance, but what does "panic" mean, specifically?