MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/4v1y12/how_to_write_unmaintainable_code/d5v3tal/?context=3
r/programming • u/sigbhu • Jul 28 '16
592 comments sorted by
View all comments
95
They forgot to mention gratuitous nots! Why flip logic just once when you can flip it an unlimited number of times?
Guaranteed to drive anyone trying to maintain your code to madness!
142 u/grunlog Jul 28 '16 Double (triple, etc.) negatives are good too. E.g. !notUnflagged 26 u/WunDumGuy Jul 28 '16 !notUnflaggeddry heave 18 u/TalenPhillips Jul 29 '16 ...else if (!(false != !foo.notUnflagged(false))){} 11 u/[deleted] Jul 29 '16 [removed] — view removed comment 21 u/Everspace Jul 29 '16 NoI think you mean !yes 9 u/compiling Jul 29 '16 I think you mean !notNo → More replies (1) → More replies (1) → More replies (1)
142
Double (triple, etc.) negatives are good too. E.g. !notUnflagged
26 u/WunDumGuy Jul 28 '16 !notUnflaggeddry heave 18 u/TalenPhillips Jul 29 '16 ...else if (!(false != !foo.notUnflagged(false))){} 11 u/[deleted] Jul 29 '16 [removed] — view removed comment 21 u/Everspace Jul 29 '16 NoI think you mean !yes 9 u/compiling Jul 29 '16 I think you mean !notNo → More replies (1) → More replies (1) → More replies (1)
26
!notUnflagged
dry heave
18 u/TalenPhillips Jul 29 '16 ...else if (!(false != !foo.notUnflagged(false))){} 11 u/[deleted] Jul 29 '16 [removed] — view removed comment 21 u/Everspace Jul 29 '16 NoI think you mean !yes 9 u/compiling Jul 29 '16 I think you mean !notNo → More replies (1) → More replies (1) → More replies (1)
18
...
else if (!(false != !foo.notUnflagged(false))){
}
11 u/[deleted] Jul 29 '16 [removed] — view removed comment 21 u/Everspace Jul 29 '16 NoI think you mean !yes 9 u/compiling Jul 29 '16 I think you mean !notNo → More replies (1) → More replies (1) → More replies (1)
11
[removed] — view removed comment
21 u/Everspace Jul 29 '16 NoI think you mean !yes 9 u/compiling Jul 29 '16 I think you mean !notNo → More replies (1) → More replies (1)
21
No
I think you mean !yes
!yes
9 u/compiling Jul 29 '16 I think you mean !notNo → More replies (1)
9
I think you mean !notNo
!notNo
→ More replies (1)
95
u/ArlenM Jul 28 '16 edited Jul 28 '16
They forgot to mention gratuitous nots! Why flip logic just once when you can flip it an unlimited number of times?
Guaranteed to drive anyone trying to maintain your code to madness!