boolean vs. bool data type

Why did Arduino bother to define a boolean data type when C++ already has bool?

Just curious.

The Arduino type works in both C and C++ modules? (Normal C doesn't have "bool"...) Sideward compatibility with Java/Processing? Beginner-friendliness?

Sideward compatibility with Java/Processing? Beginner-friendliness?

Just to confuse people?

Help folks learning to touch-type?

Trivia about enum: They consume two bytes of storage which is generally a waste. They are compatible with other integer data-types. I've been declaring the enum type so the symbols are available but using byte (or uint8_t) for storage.

PaulS:
Just to confuse people?

It confuses me. For one thing, they aren't the same:

typedef uint8_t boolean;

Try this sketch out and tell me what you get:

void setup ()
{
  Serial.begin (115200);
  Serial.println ("bool");
  bool x = 0;
  
  for (int i = 0; i < 300; i++)
    {
    x++;
    Serial.println (x, DEC);
    }
    
  Serial.println ("boolean");
  boolean y = 0;
  
  for (int i = 0; i < 300; i++)
    {
    y++;
    Serial.println (y, DEC);
    }
  
}

void loop () {}

Yeah, I noticed that. But the loops in that sketch miss the zero value. Try the one below. It looks to me like what's happening, is that the value of the bool variable is getting coerced to one or zero. Of course this does not happen with boolean, which as you observed is just a uint8_t.

This might be a reason/advantage for boolean ... less overhead in assigning values.

void setup ()
{
  Serial.begin (115200);
  Serial.println ("bool");
  bool x = 0;
  
  x = true;
  Serial.println(x, DEC);
  x = false;
  Serial.println(x, DEC);
  Serial.println();
  
  for (int i = 0; i < 300; i++)
    {
    Serial.println (x++, DEC);
    }
    
  Serial.println ("boolean");
  boolean y = 0;
  
  for (int i = 0; i < 300; i++)
    {
    Serial.println (y++, DEC);
    }
  
}

void loop () {}

Oh well, I should have done:

 for (int i = 0; i < 300; i++)
    {
    Serial.println (x, DEC);
    x++;
    }

Or what you had.