Hacker News new | ask | show | jobs
by dramaticus3 5370 days ago
You didn't check for overflow.
1 comments

Don't check for overflow. Simply use a data type so large that it would take centuries to overflow.

If you were doing a million increments per second it would take almost 600,000 years to overflow a 64 bit int.

Check your assumptions. The field could be updated at any time to any value by another connection.

And who's to say we started at zero.