Is “is Shown” or “is it Shown”? “”
My first question on Quora, so I am removing myself from Quora. I’m a native (native) Russian-Persian! As a XE architect!
I see many variables names such as isShown, hasChild, etc.
Many times
I see variables names such as isShown, hasChild etc. What does someone else use to participate in open source projects? Are these names grammatically correct? Are they just some informal uses? What is the difference between formal language and informal grammar in English grammar?
Should I use isItShown instead of
isShown and hasItChild
instead of
hasChild?
Which variables is more important than other variables in computer programming? As mentioned before, names are strings of symbols. Consequently, they are not dependent on a natural language. The compiler and parser treats them as constructs.
Your examples of names would suggest how I can change the significance of your examples? Have you ever seen a switch that lists whether you had children? The name is an abbreviated but ungrammatical sentence that helps the programmer and reader understand what the data represents.
Why?
In addition to Jeff Morrow’s answer, the program variables are not in fact used as questions (isItShown is a question). We understand the notion that does isShown is true and false. The answer to a question by isShown will be true or false.
What is the ‘is’ part of the question, and what is (probably) a binary/boolean answer? What are the names of questions in the other hand (visible, enabled, and otherwise) that indicates all answers.
Is English more grammatical than other languages? Of course not.
In addition to Jeff Morrow’s answer, the program variables are not in fact used as questions (isItShown is a question). We understand the notion that does isShown is true and false. The answer to a question by isShown will be true or false.
What is the ‘is’ part of the question, and what is (probably) a binary/boolean answer? What are the names of questions in the other hand (visible, enabled, and otherwise) that indicates all answers.
Is English more grammatical than other languages? Of course not.
Apart from the correct point that programming languages don’t have to follow English grammar, I would like to add that it is generally encouraged to write readable code, and thus, do follow the rules of English.
And your proposals don’t do that – let me expand on that.
A name like IsShown
is typically a property of an object, which would appear in usage like this:
If (SomeObject.) IsShown) Some object. What
does hide have to do with ‘If some object is shown, hide someobject,’ if to be used in a C application. If
the property would be called IsItShown, it
would allude to a sentence like *”If some object is it shown,…”, which is incorrect.
If a type of property belongs to property or method, referring back to class as it is superfluous and confusing at worst, I can add a reason here.
In the case of HasChild,
HisItChild is
equally confusing. I am not asking class B if class A has a child (in which case the name (i.e. class B) would make more sense to me), would I really want to ask class A to teach SLE? I am asking class A something about itself so I dont have to repeat who I am asking. I need help. If there are two distinct use cases for HasChild, then why
to make
a distinction between HasChild and HasChildren?
Apart from the correct point that programming languages don’t have to follow English grammar, I would like to add that it is generally encouraged to write readable code, and thus, do follow the rules of English.
And your proposals don’t do that – let me expand on that.
A name like IsShown
is typically a property of an object, which would appear in usage like this:
If (SomeObject.) IsShown) Some object. What
does hide have to do with ‘If some object is shown, hide someobject,’ if to be used in a C application. If
the property would be called IsItShown, it
would allude to a sentence like *”If some object is it shown,…”, which is incorrect.
If a type of property belongs to property or method, referring back to class as it is superfluous and confusing at worst, I can add a reason here.
In the case of HasChild,
HisItChild is
equally confusing. I am not asking class B if class A has a child (in which case the name (i.e. class B) would make more sense to me), would I really want to ask class A to teach SLE? I am asking class A something about itself so I dont have to repeat who I am asking. I need help. If there are two distinct use cases for HasChild, then why
to make
a distinction between HasChild and HasChildren?