Hacker News new | ask | show | jobs
by ars 5371 days ago
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.

1 comments

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.