Regarding programming languages, operators are constructs which behave generally like functions, but which differ syntactically or semantically from usual functions. From Wikipedia: http://en.wikipedia.org/wiki/Operator_%28programming%29

learn more… | top users | synonyms

3
votes
2answers
236 views

Greater than or identical to?

While browsing my code in a weakly-typed language I was seeing that I've trained myself to use identity (===) where logical. Then I came across a greater (or less) than or equal to (>=), and it ...
63
votes
32answers
18k views

Ternary operator considered harmful? [closed]

For example, would you prefer this one-liner int median(int a, int b, int c) { return (a<b) ? (b<c) ? b : (a<c) ? c : a : (a<c) ? a : (b<c) ? c : b; } or an if/else solution ...
70
votes
16answers
2k views

I don't understand the arguments against operator overloading

I just read one of Joel's articles in which he says: In general, I have to admit that I’m a little bit scared of language features that hide things. When you see the code i = j * 5; … in C ...
12
votes
2answers
3k views

Bitwise-OR vs Adding Flags

I've seen others use Bitwise-OR to combine flags before: #define RUN 0x01 #define JUMP 0x02 #define SHOOT 0x04 const byte madPerson = RUN | JUMP | SHOOT; That's also the way I do it. But I've ...
11
votes
6answers
5k views

What are the advantages of using bitwise operations? [closed]

Following reading the latest CodeProject newsletter, I came across this article on bitwise operations. It makes for interesting reading, and I can certainly see the benefit of checking if an integer ...
6
votes
3answers
738 views

How useful are infix operators in a programming language?

How useful are infix operators in a programming language? Are they worth the extra complexity they provide? Can you provide any examples where infix operators are better suited to the problem that ...