3 ms·
Lol, reminds me of the meme: var a = true; if(a == true) then return true; else if(a == false) then return false; Or something like that.
by moralestapia 5y ago
Lol, reminds me of the meme:
var a = true;
if(a == true) then return true;
else if(a == false) then return false;
Or something like that.
- hibbelig 5y agoI once looked at 30 lines of code, analyzed them and found out that they always computed true, never false. My background knowledge told me that Zeit was the correct value. But I did not dare to eliminate it in the main branch, only in a refactoring branch that I think got never merged. I am not proud.
- asddubs 5y agoi hate to say that I've definitely written code like that. not any time recently, thankfully (at least I think)
- tonyedgecombe 5y agoThe thing is it’s easy to imagine a situation that leads to this. It’s five o’clock on Friday, your partner is hassling you to get home because you have visitors, you are exhausted because you worked 60 hours this week and your boss is breathing down your neck because they want their pet feature finished right now. This is why I’m always loathe to criticise stuff I see on WTF.
- moralestapia 5y agoI could totally conceive places where "you have to write at least N lines of code per day" and then this kind of thing explains itself.
- MBCook 5y agoI have seen that in real code. No kidding.
- deleted 5y ago[deleted]
- Aardwolf 5y agoelse throw "this should never happen";
- LandR 5y agoI've seen this in production code: public static bool ConvertToBoolean(this int number) { var TrueOrFalse = false; if(number != 0) TrueOrFalse = true; return TrueOrFalse; }