I know you pronounce equality ==
in if(x == 5)
this way
If x equals to 5 . . .
But how do you utter it in a coding context (assignment); i.e. =
in x
=5
?
maybe something like:
x be assigned to 5
What would you say?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.
Sign up to join this communityI know you pronounce equality ==
in if(x == 5)
this way
If x equals to 5 . . .
But how do you utter it in a coding context (assignment); i.e. =
in x
=5
?
maybe something like:
x be assigned to 5
What would you say?
There are very minor differences but they are basically the same:
if (x == 5)
Is pronounced - if x is equal to five
x = 5
Is pronounced - x equals five
Another, more technical way (the above is a colloquial term) is set x to five
.
Programming Answer:
If (x == 5) { (code) }
tells the computer:
If (x is equal to 5) { Do this code }
While
x = 5
tells the computer
The variable x currently has the value of 5. (Anywhere the variable "x" is used the value of 5 will replace it unless x is changed later)
The reason we use "==" for "equals" is because we had already decided that " = " means "is assigned to"
Math Answer
In algebra and calculus "x = 5" would be "x equals 5"