Boolean Comparison in Production
Found this in production today. I need a drink. public static bool CompareBooleans(bool orig, bool val) { return AreBooleansEqual(orig, val); } internal static bool AreBooleansEqual(bool orig, bool val) { if(orig == val) return false; return true; }
A screenshot shows a programmer discovering production code where a function named AreBooleansEqual returns false when two boolean values are equal and true when they differ. The absurdly inverted logic explains the caption about needing a drink, making it a reaction to bad or confusing code. EN: A screenshot shows a programmer discovering production code where a function named AreBooleansEqual returns false when two boolean values are equal and true when they differ. The absurdly inverted logic explains the caption about needing a drink, making it a reaction to bad or confusing code.
code screenshot / скриншот кодаprogramming text / текст программыboolean values / булевы значенияfunction definition / определение функцииdark background / тёмный фонwhite text / белый текстblue syntax highlighting / синяя подсветка синтаксисаsource code / исходный кодproduction environment / рабочая средаdrink reference / упоминание напитка
- @gentoomemes / 8861 2024-01-20
- Type
- image
- Size
- 800×526 · 39.3 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added