Hacker News new | ask | show | jobs
by nickff 3970 days ago
But you have to balance the probability of a problem with its severity. I do a lot of work in C with pointers and arrays, and there are many situations where I select unsigned ints because (, although problems are more likely,) there are less likely to cause a memory read or write error (for my application, though not necessarily for others). I also often use unsigned when I am doing math that includes logs, because I am less likely to cause a math error.

I would like to be clear that I agree with your assessment for most situations, with some exceptions.