Why do Arduino programmers use int rather than byte for pin numbers?

Is there a reason that int is so heavily favored, such as 'const int', for definitions of pin numbers? Why not use byte?

old habits die hard? It really does not matter since the compiler optimizes away the constants so neither take any memory.

Target Audience. See: Arduino - StyleGuide

@ocuser, There was no need for you to start two Threads about what is essentially the same question.

My answer (to both of them) is that the person using a too-big datatype does not know any better.

...R

BLH64 - It really does not matter since the compiler optimizes away the constants so neither take any memory.

Thank. That's a good point to remember.

Robin2 - @ocuser, There was no need for you to start two Threads about what is essentially the same question.

Those questions are, in fact, two different questions, as is made clear by the answer provided by BLH64.

Did you notice my comment in the Boolean question… “My fear in posting…”

Chastisements, such as yours, are the reason so many newbies get pushed out of forums. Also, you are surely aware that if I posted two different questions in the same post, others would chastise me for that.

The good news is I’m not a complete newbie and my old skin is quite thick. My recent introduction to the Arduino feels like immense resources compared to the microcontrollers of 40 years ago. Nevertheless, I write all these words, after decades of experience with forums dating back to 300baud, to kindly request that chastisements be made more gentle and newbies be made to feel more welcome. And I write that, knowing those who chastise generally don’t accept chastisement. But perhaps other kind souls will be reminded of the need to gently welcome new comers.

(deleted)

ocuser:
Those questions are, in fact, two different questions, as is made clear by the answer provided by BLH64.

I don’t agree. They are both about the simple (and often inconsequential) error of using a too-big datatype.

…R

Beginners only know "you have to put int before a variable name" having no idea what it means, whether it's one bit or 64.
If you write:

Serial.begin(115200);

You'll get:
"Your program makes garbage on my screen".

“ Is there a reason that int is so heavily favored, such as 'const int', for definitions of pin numbers? Why not use byte?”

Why not use ‘const byte’ ?

Wonder what the next posting title will be :wink: