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 ???
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.
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.
boolean is a primitive boolean type, not an object. Boolean is the wrapper object for a boolean . bool doesn't exist.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With