bool vs boolean

Which should be used for variables storing true / false values? bool or boolean?

I've seen both used. There seems to be preference for bool. But, boolean is hilited by the IDE.

  • Brian

Arduino defines a boolean type, it is identical to the terse C++ bool type. Either can be used, but boolean is friendlier for non-programmers.

It would be nice if the Arduino IDE highlighted "bool" as well as "boolean" as a keyword.

although most of the underlying C++ is available, according to the Arduino language reference, boolean is the documented data type. Highlighting language element underneath the Arduino abstractions could be confusing for people coming into this without C/C++ experience.

You can always add it yourself; the keywords are in the keywords.txt in the lib directory

Good point.