Java has
int
andInteger
boolean
andBoolean
This seems a bit inconsistent, why not either
bool
vsBoolean
to use an established shorter name for primitive type?
or
integer
vsInteger
to keep type names consistent?
I think C++ had decided to use bool
quite a bit earlier than Java decided to use boolean
, and maybe also some (non-standard at the time?) C extensions too, so there would have been historical precedence for bool
. I've noticed I often instinctively try to use bool
at first (good thing modern editors immediately spot this without extra compilation round), so it'd be nice to know the rationale behind current state of affairs.
If someone remembers (a part of) the story, or can even find and link to relevant historical discussion in the net, that would be great.
boolean
is definitely more explicit thanbool
. I'd rather ask whyint
is not calledinteger
. My guess:int
andchar
where too ingrained to be changed tointeger
andcharacter
, butbool
was not yet fully established.bool
type was introduced to C++ in 1993. Java includedboolean
in its first release in 1995, but the Java project itself was started in 1991. Without finding further sources of information, it's not clear to me which came first, or what (if any) influence they had on each other.boolean
type. (Oak was later renamed to Java). That pushes the dates even closer, though I still see no definite evidence to show precedence, or influence, in either direction.