pert:
You said:That is an indisputable statement that you're confused.
It's not a true/false argument. It's a pin state. Just because HIGH is 1 and LOW is 0, doesn't mean you should equate them to true and false.
I think it's a reasonable point of view that I share for the most part. However, I dispute that bool is the "right' data type for a pin state.
You can do that with any integer data type.
Not to me at all. If Running was actually used to store true/false data I would consider it a reasonable opinion (though the former is still less beginner-friendly). However, assuming the value of HIGH is 1 and the value of LOW is 0 is not a good idea. Nowhere does Arduino guarantee what these values will be. They simply represent pin states, not boolean states. You can probably get away with it, but it's certainly not best practices.
I was not doing a digitalRead of a pin state and trying to toggle that, I have a bool flag "LED_Blink" that says we need to blink the LED, and a bool flag that is toggled when we need to change the state of the LED after the allotted time.
Together with the LED_ON bool flag, which overrides the blink state, it allows me to use the "logical OR" ||, which is clearly stated in the reference as a "Boolean" operator.
I have never assumed that HIGH == true, or vice versa. In my last example, Running is a state that is either true or false, it can't be anything else, so using a bool data-type to store that information, in my mind, is the correct thing to do, and I believe does make the code easier to read and understand.
I work a lot with PLCs, especially Allen-Bradley, and you simply cannot attach an integer data-type to a boolean instruction like XIC or XIO, it has to be a BOOL data-type. Conversely, you cannot write a value to a boolean output, whether it is just 0 or 1.
To me, matching data-types to the functions they perform, or the data they have to hold, is natural. As a beginner in PLC coding over 35 years ago, I was forced into it. Now I'm a relative newcomer to Arduino C/C++ and find it slightly at odds that the language allows what in my mind, would be confusing to a beginner.