34
nebula
2y

Found this gem and just wanted to leave it here :-|

Comments
  • 10
  • 7
    It's dead code, right? ... Right?
  • 8
    ...And I had insecurities about my code quality. Thank you.
  • 2
    It is a 50/50 chance
  • 9
    >0 references

    Thank god
  • 12
    @LotsOfCaffeine it's used in xaml. and therefore it shows no references :S

    this is production code and in use. Already fixed it though. I couldn't leave it like that.
  • 4
    Just changing the signature to return bool would be a huge improvement; then at least people would be like "wtf is this" without even having to look at it.
  • 7
    @spongessuck some might question why we need a class to invert a boolean in the first place
  • 4
    oooooh fuuuck... quite sophisticated code...
  • 9
    Is not is as bool? Yes.
  • 1
    (Object)null is true.
    That triggers me
  • 2
    @ElectroArchiver Damn. Im crying🤣🤣
  • 0
    I wonder why are all those checking needed? C# is a very strongly typed language, and all of the time, we know very well what is a method's return value.

    Why even need to check if the value's type is a "bool" or "bool?"

    Also C# has Convert.ToBoolean if somehow, the value's type is really unknown.
  • 1
    That’s very amusing to me, I think the person that wrote this must have banged their head against they keyboard in agony because otherwise why would you add these checks 😂
  • 0
    That's productivity. The guy writes already obfuscated code.
Add Comment