Why use int instead of byte?

Doug101:
In almost all of the sample sketches I've looked at, integers (int) are used to are used when referencing the IO pins. Why int and not byte?

Seems to me byte would make a lot more sense as I/O pins can only be positive, (int can be negative) and there's no need for 2^16 / 65,536 with int when 2^8 or 256 would be more than enough.

Anyone have a good explanation?

Thanks

C programmers tend to use int everywhere, because C automatically promotes things to int if they are smaller. I belive this also includes function arguments, although I'm not 100% sure. On a machine that has a 16-bit bus, using bytes doesn't win you anything in terms of speed: it all goes across the wires simultaneously. Since pin numbers tend to be constants that are subbed in by the compiler, using a byte doesn't make the sketch smaller. And even if it did, the sketch would only be smaller by a byte or so.

Personally, I use byte because the pin io functions are decalared to take a byte.