Tag Archives: Lesson learned

Off-topic: A C# lesson learned about conditional operators

If it was hard to write, it should be hard to understand, that’s an unwritten rule-that-rules-them-all of programming. You absolutely love to apply syntactical stunts to impress your coworkers, especially if you do C# and they don’t, don’t you?

One of those stunts (at least from C/AL) perspective is a C-language type common feature known as conditional operator. It allows you to write this:

when you would normally (in C/AL, for example) get more eloquent:

This (b == true) could have been replaced with just (b), but I put it there for clarity.

But! (There is always a “but”!)

Continue reading Off-topic: A C# lesson learned about conditional operators