# something != something else

**URL:** <https://boards.straightdope.com/t/something-something-else/77166>\
**Category:** About This Message Board\
**Created:** [August 20, 2001, 4:26pm UTC](https://boards.straightdope.com/t/something-something-else/77166 "2001-08-20T16:26:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atreyu](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@Atreyu](https://boards.straightdope.com/u/Atreyu)\
**Post date:** [August 20, 2001, 4:26pm UTC](https://boards.straightdope.com/t/something-something-else/77166/1 "2001-08-20T16:26:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Eyke](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eyke](https://boards.straightdope.com/u/Eyke)\
**Post date:** [August 20, 2001, 4:30pm UTC](https://boards.straightdope.com/t/something-something-else/77166/2 "2001-08-20T16:30:48Z")

</div>

Atreyu:

You are right “!=” means “not equal to” it is an expression used in programming languages. It is not unique to the Internet or SDMB.

HTH

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [August 20, 2001, 5:38pm UTC](https://boards.straightdope.com/t/something-something-else/77166/3 "2001-08-20T17:38:11Z")

</div>

! 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”.

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [August 20, 2001, 5:42pm UTC](https://boards.straightdope.com/t/something-something-else/77166/4 "2001-08-20T17:42:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Atreyu](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@Atreyu](https://boards.straightdope.com/u/Atreyu)\
**Post date:** [August 20, 2001, 9:54pm UTC](https://boards.straightdope.com/t/something-something-else/77166/5 "2001-08-20T21:54:59Z")

</div>

Thanks for clearing that up. I’m not a programmer, which is probably the reason why it baffled me.

---

<div class="post-metadata">

**Author:** ![Cleophus](https://avatars.discourse-cdn.com/v4/letter/c/a88e57/32.png) [@Cleophus](https://boards.straightdope.com/u/Cleophus)\
**Post date:** [August 22, 2001, 4:07am UTC](https://boards.straightdope.com/t/something-something-else/77166/6 "2001-08-22T04:07:03Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![waterj2](https://avatars.discourse-cdn.com/v4/letter/w/858c86/32.png) [@waterj2](https://boards.straightdope.com/u/waterj2)\
**Post date:** [August 22, 2001, 4:21am UTC](https://boards.straightdope.com/t/something-something-else/77166/7 "2001-08-22T04:21:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Kamino\_Neko](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/kamino_neko/32/34_2.png) [@Kamino\_Neko](https://boards.straightdope.com/u/Kamino_Neko)\
**Post date:** [August 22, 2001, 4:44am UTC](https://boards.straightdope.com/t/something-something-else/77166/8 "2001-08-22T04:44:31Z")

</div>

IIRC, Pascal used \<\> for ‘does not equal’.

---

<div class="post-metadata">

**Author:** ![Derleth](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Derleth](https://boards.straightdope.com/u/Derleth)\
**Post date:** [August 23, 2001, 12:41am UTC](https://boards.straightdope.com/t/something-something-else/77166/9 "2001-08-23T00:41:59Z")

</div>

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:

```auto

if (p = q){
 p++;}

```

when you mean this:

```auto

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.

[Here is FOLDOC on the issue.](http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?equals)
