Found This Boolean Logic 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 Twitter post shows absurd C# code that names a function AreBooleansEqual but returns false when two boolean values are equal and true when they differ. The programmer says they need a drink after finding this confusing production code, making it a reaction to bizarre legacy code and software-development mistakes.
bearded cartoon avatar / мультяшный аватар с бородойcomputer code / компьютерный кодtweet screenshot / скриншот твитаdark mode interface / интерфейс в тёмной темеwhite text / белый текстblue syntax highlighting / синяя подсветка синтаксисаboolean comparison function / функция сравнения булевых значенийprogramming text / текст программыsocial media post / публикация в соцсети
- @dev_meme / 848 2019-11-24
- Template
- Twitter screenshot
- Type
- image
- Size
- 640×726 · 50.4 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added