Comment

Comment by hornban

I recall that it was either old versions of Solitaire or Freecell that had the same issue. I remember intentionally losing games until my points were -32767ish, and it was the first time I experienced integer wraparound as a kid. That's the sort of thing that teaches you a lot unintentionally.

Anyway, I think that it's not really surprising that they'd use a signed integer in either case. In every codebase I've ever worked on, signed ints are the default merely because they're the obvious choice for a number. I only see uints when it actually matters, or when a developer is overly pedantic.

parent hornban 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton