

Signed Integers Considered Stupid (Like This Title) - blackhole
http://blackhole0173.blogspot.com/2011/11/signed-integers-considered-stupid-like.html

======
sixtofour
"The places where this become stupid are things like using an integer for
height and width, or returning a signed integer count. Why on earth would you
want to return a negative count?"

Manipulating values that don't seem, at first cursory glance, to need negative
values using unsigned integers can be thought of as over specification. The
difference between two heights can be negative, and adding the differences in
and out of measurements would be much more convenient if negative values were
allowed. Altitude above sea level can quite easily be negative if we add in
ocean depth. It depends on the context, and a blanket prescription is overly
restrictive.

Even in your for loop example, it could make sense to use a signed integer.
Requirements could change, and you might later need to start or end at less
than 0. If you had prematurely specified unsigned, then you have to change and
double check all code when you eventually need to change your loop. Again, it
depends more on context than a blanket prescription.

"This is retarded."

This kind of language greatly reduces the desire to read the rest of your
argument.

"I can only attribute the vast overuse of int to programmer laziness. unsigned
int is just too long to write. Of course, that's what typedef's are for,"

There are other non-lazy reasons to use int. And I don't believe obscuring a
primitive type is the best use of typedef, but that's my opinion.

