I’ve seen in a few threads this construction, where a comparison seems to be made between two different things. It reads something like this:
“something != something else”
At first I thought that the exclamation mark was a typo, but I have seen this used in more than place and by different posters. From the context, I assume that “!=” means “does not equal”, but I was hoping that someone could correct me if I’m wrong. I’ve never seen this used anywhere else, and so I’m not sure if this is shorthand unique to the Straight Dope Message Board or to the Internet in general.
! is the symbol for “not” in many programming languages. Other shorthands you’ll see occasionally for “not equal” are /= (an attempt to represent an equals sign with a slash through it, the mathematical symbol) and ~=, from the symbol used in logic for “not”.
I’ve never seen this one on the SDMB, but some languages (Visual Basic comes to mind) use “<>” to mean “not equal to”. So if you see that, you know what it means.
Conversely, you may see “something == something else”. The double equal sign is used in programming to mean equals. (A single equal sign is generally used to assign a value to a variable, ex. “foo=3” gives the variable foo the value of 3)
Although (and I’m going by rather fuzzy memory now) Pascal used = for comparisons and := for assigning values. Can’t remember what it used for inequality.
In C, p != q means p does not equal q, p = q means p is assigned the value of q, and p == q means to check if p and q are the same value. So you can get into trouble if you type this:
if (p = q){
p++;}
when you mean this:
if (p == q){
p++;}
In the first case, p is always incremented if the value in q is nonzero, because assigning the value of q to p always yields a ‘true’ result if q is nonzero. In the second case, p is only incremented if it is, in fact, equal to q.