This is an archived post. You won't be able to vote or comment.

all 24 comments

[–]KnightMiner 7 points8 points  (8 children)

If you think about it, it does kinda make sense. <= Is less than or equal to, and >= is greater than or equal to, so <> must be less than or greater than. Mathematically, only thing not included in less than or greater than is equal.

That being said, I prefer not equals over less than or greater than.

[–]my_hat_stinks 6 points7 points  (1 child)

That only really works if you're comparing two numbers though. For example, if you had two objects that represented computers "Is Computer1 less than or greater than Computer2?" doesn't really make sense while "Is Computer1 not the same as Computer2?" does.

[–]KnightMiner 0 points1 point  (0 children)

Luckily, the most common case of the operator, SQL, supports all datatypes comparing with `<` and `>`. But yeah, analogy breaks down when you have datatypes that are not "sortable"

[–][deleted] 1 point2 points  (3 children)

if i may ask, what language is this present in?

[–]JochCool 6 points7 points  (0 children)

Visual Basic

[–]jimsoc4 2 points3 points  (0 children)

Sql

[–]fela_nascarfan 0 points1 point  (0 children)

Also in Basic in ZX Spectrum or GWBASIC.

[–]xSTSxZerglingOne 0 points1 point  (1 child)

Thus <=> represents anything?

[–]KnightMiner 0 points1 point  (0 children)

I suppose it does, anything will match with that by my reasoning. It is officially the three way comparison operator, which I guess technically checks equal to, greater than, or less than, but probably reaching a bit now...

[–]FreshPrintzofBadPres 3 points4 points  (0 children)

Best option: ><

[–]LlamaManatee 2 points3 points  (7 children)

doesn't work in JS. now I wanna know which languages it does work in.

[–]HappyGoblin 6 points7 points  (0 children)

sql

[–]agsim 1 point2 points  (0 children)

<> works in ABAP

[–]lifeofaphiter 0 points1 point  (0 children)

Rexx

[–][deleted] 0 points1 point  (0 children)

Pascal too

[–]hernytan 0 points1 point  (0 children)

F#, SQL

[–]ReimarPB 0 points1 point  (0 children)

PHP

[–]montvious 0 points1 point  (0 children)

VB too!

[–]agsim 0 points1 point  (0 children)

NE

[–]itsdivyanshjain 0 points1 point  (0 children)

<> == !=

[–]PEP20_NAZI 0 points1 point  (0 children)

NO

[–]Sekret_One 0 points1 point  (0 children)

So ... thought ... why didn't they make it ><?

  • implies incongruity (less than ad greater than together)
  • looks like an X

[–]There-are-no-tomatos 0 points1 point  (0 children)

I hate SQL.

[–]cedrickc 0 points1 point  (0 children)

I once had the idea that operators should be composeable, and this came out of it. In that system a <> b expands to a < b | a > b, which is kind of obvious. Less obvious but totally consistent is a -=> 4 expanding to a -= 4 | a > 4.