Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Boolean And bool

Tags:

c#

From the link ( which is mentioned in Question) my question is that microsoft says "The C# type keywords and their aliases are interchangeable" But why we need Aliases, From my point of view Boolean is more meaningful then bool and Int32 is more meaningful then int then why aliases ???

like image 627
Asim Sajjad Avatar asked Mar 18 '10 12:03

Asim Sajjad


People also ask

Is bool the same as boolean?

In computer science, the Boolean (sometimes shortened to Bool) is a data type that has one of two possible values (usually denoted true and false) which is intended to represent the two truth values of logic and Boolean algebra.

What is difference between bool and boolean in Python?

The boolean data type is either True or False. In Python, boolean variables are defined by the True and False keywords. The output <class 'bool'> indicates the variable is a boolean data type. Note the keywords True and False must have an Upper Case first letter.

What is the difference between bool and boolean in Java?

boolean is a primitive boolean type, not an object. Boolean is the wrapper object for a boolean . bool doesn't exist.

What is the difference between boolean and Boolean data types?

boolean is a primitive type whereas Boolean is wrapper class. Same applies for (int,Integer),(long,Long) etc. Wrapper classes "wrap" the respective primitive data type into an object of that class. They are used with collections, as primitive types are not allowed with collections.


2 Answers

Because C# tries to be a bit like C/C++ for familiarity. You are welcome to use the long names if you wish, but I think most people prefer the short names.

like image 115
Mark Byers Avatar answered Sep 28 '22 18:09

Mark Byers


Because programmers are lazy and Microsoft wants to do them a favour.

I prefer the long names but most former C++ programmers will be used to string, int, float and double.

like image 31
Morfildur Avatar answered Sep 28 '22 17:09

Morfildur