3
Today I came across a peculiarity of C# which I had never stopped to pay attention to:
When converting a value bool
for string
, the result is a text in Camel case:
string verdadeiro = true.ToString(); //Converte para True
string falso = false.ToString(); //Converte para False
However, to use the literal values in the language, you need to write them in low box, write them in Camel case causes build error:
bool verdadeiro = True; //Não compila
bool falso = False; //Não compila
What is the reason for this difference?
Don’t you think only those who made the language can answer that?
– Jéf Bueno
Certainly a thorough knowledge of language is needed...
– Marcell Alves
It’s not a matter of knowledge, it’s a matter of design, did so and it is so. The reasons behind this only those who decided can answer.
– Jéf Bueno
Do you have a question that is irrelevant to the community? If it is the opinion of the other moderators, may I remove it.
– Marcell Alves
I’m not a moderator and I just asked a question.
– Jéf Bueno
I know, I think your question is relevant, so I left open the possibility of eliminating the question if it doesn’t add any relevant knowledge to the community.
– Marcell Alves