“set 3 to x” vs “set x to 3”

By Xah Lee. Date: .

which is correct? “set value to variable” vs “set variable to value”

as native speaker, you'd say the first.

assign val to var 20210602121734
assign val to var [from http://english.stackexchange.com/questions/51343/assign-a-variable-to-a-value-or-the-other-way-round]

But, there's problem.

When we have x = 3, it's natural that we say give x a value. Or simply, set x to 3, corresponding naturally to x = 3.

I would say, either way is fine, because it does not create ambiguity. One is a value such as 3, one is variable such as x, and it can only go one way, doesn't matter how you say it.