Hacker News new | ask | show | jobs
by nkurz 4658 days ago
I think most people would understand the difference if asked. There are all sorts of reasons, but no great ones:

  1) Tutorials usually use 'int' (self-referential)
  2) 'unsigned' is one more thing to type.
  3) It can be hidden behind a typedef.
  4) Negative numbers can serve as error codes.
  5) Wraparound can cause bugs for either.
  6) Occasionally safer (if x - 3 < 0)
I've usually taken to using explicit width unsigned integers (uint32_t) unless there is a reason not to.