!=

:confused:

I take from context that it means “does not equal” or something like that but where did it come from? At first I thought it was part of a computer language but I’ve noticed that the percentage of people that use it here seems to be much higher than the percentage of computer programmers here. Also, this is the only place I’ve ever seen it.

Did I miss the bus on a new trend or are there a bunch of comp-sci posers running around here?

I’ve seen it for years in both computer science and pure academic math settings. !, in general, means “not” or “the opposite of”.

It’s from computing certainly, I think it’s from C originally but it could pre-date that too, I know it’s not in Pascal. I can’t help you with how it became popular.

Actually I’ll take a guess, as we can’t do the mathmatical struck-through = easily I’ve seen people use = for not equals. I guess since != is similar and is familiar to more people that it just took over.

SD

Amongst the hundreds of computer programming languages and dialects there are 3 common computer language symbols for not-equals.

One is !=, the second is <>, and the third requires a special symbol that may not come through on your system, but looks like a em-dash with a short tail hanging down from the right edge: ¬=.

The second version is not very compatible with HTML, and particularly in the early days of online life, posts or docs containing <> would either be rejected, or the symbol would be eaten completely, so nothing appears on screen. IOW a statement that “a <> b” would render as “a b”, which sort of loses the point.

And the third version requires an unusual symbol that may not be included in the font you’re viewing my work in.

So as a result, != wins out; it’s the most typographically reliable in the online world.

There’s no computer language I’m aware of which uses /=. Perhaps math grad students used it when typing term papers before the advent of math-specific word processors, but I’d sooner expect them to use an overstrike so the / was on top of the =. The ability to make up combination characters is/was the only real advantage of typewriters over word processors.

Thanks for the info. It’s been awhile since I’ve done any programming but I remember using <>.

In any case, outside of the context of programming or math problems I think I’ll stick with “does not equal”. I don’t have to hit shift or fumble for the equal sign, and for some reason the look of != just seems to grind on my nerves. I guess it just looks…pretentious.

For R&D work and proof-of-concept, my colleagues and I use a lot of MATLAB before developing in C.

MATLAB’s “not equal” is “~=”. It’s kind of odd considering we are reasonably sure that MATLAB itself is developed in C++.

And of course in COBOL there is “NOT =”, but that doesn’t have the same smell of geekdom.
RR

A coder will read != as “not-equals” and !true as “not true”. It’s about as pretentious as using French, the degree of pretentiousness depends on the proportion of French speakers in the audience.
At the risk of taking this too seriously I’d say if you aren’t a coder or you’re writing for an audience who won’t all get it then using != is naff.
If you can cite an example we can judge on the pose-osity.

It comes from C and is used in all the C-like curly brace languages and in SQL and in loads of others.

Where I work we use the Oracle language PL/SQL where != and <> are interchangable. You can tell the background of programmers by which one they use. Coders who learned Visual Basic first use <>, those who learned C/C++ use !=.

Or any kind of BASIC, it’s not limited to Visual Basic.

!= seems to be the most common for newer languages, many of which have syntax based on C. Java, for example.

While it definitely started with programmers, the use of != on message boards is becoming so common that it’s basically risen (or sank, depending on your point of view) to the level of any other Internet abbreviation, like LOL, IIRC, SDMB, etc.

I know of only one language that does so. ISETL, a software package for teaching/doing abstract algebra, uses /= to mean “not equal”. It caught me off-guard at first, too.

When in a context which allows for custom characters (a whiteboard and markers, for instance), the equals sign with the slash through it is definitely preferred, but other than that, != is the best option. <> is not exactly synonymous; the statement “i <> 1” is false (where i is the imaginary unit), but the statement “i != 1” is true. <> only works well where there is a natural ordering on the objects being compared.

One thing to keep in mind is that computer programming is no longer a subject perched atop the Ivory Towers as it once was. From my experience, computer programming/computer science is now standard issue in highschool curricula (sp?).

The point of this being that there are far more people out there who do in fact have some knowledge of computer science.

At my school, Computer Science is a required course for graduation. In fact, many, many people take APCS after Compsci sophomore or junior year. I’m taking it in summer schol after sophomore year, and then taking APCS junior, myself.

Of course, my school’s requirements for graduation are fairly ridiculous, so YMMV.

VHDL does this too. One of many annoyances with VHDL.

(Although VHDL is technically a hardware description language and not a programming language.)

In academic math it’s almost always traceable to a computer science influence. A pure mathematician would strike through the relational operator to negate it.

Prolog uses /=, I think. I hate that language.

Just wanted to point out that the struck-throuh = is an extended character in the Symbol font. Alt+0185.

Haskell is another language that uses ‘/=’ for ‘not equal to’.

Another reason why ‘/=’ may not be so popular is that it has an entirely different meaning in C: divide and assign. ‘x /= y’ is shorthand for ‘x = x / y’ in C. OTOH, people seem to be no problem using ‘=’ as equality, even though it is the assignment operator in C (’==’ is the C equality operator).

Not sure about other languages, but in Visual Foxpro (Foxpoo?), <> and != can also be expressed as #. As in 5 # 6.

Just my ! so useful $.02

Euphoria uses !=… it’s kinda sorta C++ based.

/= is also valid, but is a shorthand.

A /= B is A = A/B
Similarly with *-, +=, and -=.

I’d wager this type of shorthand has more to do with /= not being favored.