TITLE: What is $x=5$ called??
QUESTION [9 upvotes]: I have CS background, and I'm trying to teach fundamentals of programming to students. They seem to have difficulties in understanding the difference between x=5 and x==5. However, trying to explain, made me wonder what the meaning of $x = 5$ is in mathematics.
Is there a concept of assignment in mathematics? Or is this an equation/binding/statement/something else? What is its proper name? And does the use of the $=$ operator differ from its use in the function below?
$$f(x) = \begin{cases}
  \displaystyle 1 \quad \text{if } x \bmod 2 = 0\\
  \displaystyle 0 \quad \text{if } x \bmod 2 = 1\\
\end{cases}$$
Is there a classification of the uses of equality operator in math? Or is it the same in every case, and I just fail to see it?

REPLY [4 votes]: In addition to the "identity equals" and "conditional equals" that B.Goddard suggests, you might also teach "Yoda conditions" so that if an '=' is inadvertently omitted, a syntax error would result.
They are named for the famous Jedi master whose syntax is often reversed. In C-type programming languages, x == 5 and 5 == x are equivalent. Some environments, like WordPress, have programming practices that include Yoda conditions.   
For example, if you mean to code 
if( x == 5 ) { /* code */ }

but accidentally type
if( x = 5 ) { /* code */ }

you will have hours of pain trying to find your error. However, if you intend to code a Yoda conditional like
if( 5 == x ) { /* code */ }

but on accident type
if( 5 = x ) { /* code */ }

an error will result. No debugging necessary; the system tells you where the error is.
In other words, the difference between x = 5 and x == 5 is unique to CS. Your students simply need practice with it to understand it. In my opinion, Yoda conditions will help avoid a common error until the understanding is deep enough that making such an error will no longer be an issue.