What is the correct way to express a phrase containing the word "assign"?

Forgive me for such a basic question; it is (I suppose) more of an English question than a programming question; but I think that as software developers we make such statements on a fairly regular basis.

If I have this code:

int x = 0;

... does the above "assign xto 0" or assign 0 x"?

It just bugged me. Feel free to close if you know about the best place to ask (although if someone provides a convincing answer before this question is closed, I will be happy).

Change . The best part about this code is that if I talk about it, I could really express it anyway, and it should be clear what I mean for any thinking person (as 0it is not a variable). I just know that sometimes I get into the mental wall when I try to explain this line:

x = y;

If I say "he assigns, y x" I say something that (of course) means the opposite of what I would say if I said "he assigns x y"; but both seem reasonable!

Oh good...

+3
source share
3 answers

Webster.com : "" " " (, , , ). 0 x.

+7

assigning 0 to the variable x.

+3

It "assigns 0 to x" or "sets x to 0".

+2
source

Source: https://habr.com/ru/post/1774733/


All Articles