4

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?

  • I would say "5 is assigned to x", or "x is filled with 5"... but I'm not native english. In my native language (french), there is no way to say it "nicely". We would better talk of "x is initialized to 5". – Random Aug 7 '15 at 8:18
  • I would say for X equal to 5 – Lucian Sava Aug 7 '15 at 8:28
  • The first question (which nobody asked) should be: What programming language is this, that uses double "=" signs? Because yours is not a question about English; it is about that programming language. In BASIC , assigment is "LET A=B" (let A equal B) In C, you can say things such as "B++" (increment B). How you say it has nothing to do with English rules; it depends on the programming language's syntax. – Brian Hitchcock Aug 8 '15 at 10:09
4

There are very minor differences but they are basically the same:

Comparison

if (x == 5)

Is pronounced - if x is equal to five

Assignment

x = 5

Is pronounced - x equals five

Another, more technical way (the above is a colloquial term) is set x to five.

0

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"

  • So how do pronounce eventually? the same algebra way? – Milad Aug 7 '15 at 8:36
  • 1
    I always say x=5 as "x equals five" @Milad even though it is technically incorrect. – SolarLunix Aug 7 '15 at 8:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.