Ugly condition in C# or way to make your code shorter...

by Igor 10. December 2008 08:37

Today I've registered on stackoverflow.com and someone got an interesting question about C#: !IsGood vs IsGood == false. I was irritated by idea to check boolean variables this way so many times

if (boolVar == false) { ... } 

But some time ago I have discovered one case where I *LIKE* to write something very simlarly looking :) Read my full answer to this question. As some kind of bonus you will find out how NOT to use operator overloading in C# ;)

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.NET | C#

Comments

Add comment


 

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Hi! My name is Igor Khavkin. I'm Senior Software Developer, mostly doing C# / .NET nowadays but have Java experience in the past. Dealing with newest .NET technologies (C# 3.0, LINQ, WPF) in real world applications, have experience in parser construction for large scale projects analyzing SQL. Very interested in complex projects that need to solve non-trivial algorithmic and/or mathematical problems.

For more details see or plain text.

Tag cloud

    Month List