ID:1896547
 

Poll: Which do you prefer to use?

!= 95% (22)
<> 4% (1)

Login to vote.

Normally the != operator is commonplace in C++, though the <> operator is commonplace in Basic. I come from a Basic background, though I could use either one. I started using <> today and I actually quite like it over !=.
I like both of them equally, but I picked != since I use it more and there wasn't a 'both' option.
I've always used "!" to signify NOT in just about every language I've ever used that allowed it, it makes a lot more sense in the context of

if(!condition)
For the purpose of the poll, I voted for != as it makes more sense to me than <> to represent "not equal", but I have come to prefer using the "alpha key" ne after working with an older CNC controller at work that didn't have less than or greater than symbols available. I find that alpha keys are easier for me to type, and easier to identify and read in conditional statements.
Other alpha keys I use are:
#define eq ==
#define lt <
#define gt >
#define le <=
#define ge >=
#define ne !=
!= is just such a simple read for me, plus it's more to the point than a <> operator. NOT EQUAL TO is much better understood than LESS THAN OR GREATER THAN.
Oh wow. This is very interesting feedback. It's really neat to see why people prefer ine style or another. Like, I hadn't even thought about <> representing "not greater than or not less than." And as for Higoten's approach, that is also quite neat. Usually I prepare a small list of defines for things like that myself.
#define and &&
#define or ||
// etc.
In response to Mr_Goober
Me personally, defining operators or keywords like that would just confuse me. I'm too used to raw operators. Lol.
In response to Nadrew
Nadrew wrote:
I've always used "!" to signify NOT in just about every language I've ever used that allowed it, it makes a lot more sense in the context of

> if(!condition)
>


This, unless the value differs from True or False ( 1 or 0 ) then != would be used.

Never seen <> used in modern web languages.

As Katz said != is more readable than <> IMO..
unless the value differs from True or False ( 1 or 0 )

Or null/non-null.