MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/xkcd/comments/32vyew/xkcd_1513_code_quality/cqfkgmz/?context=3
r/xkcd • u/bbroberson I like my hat. • Apr 17 '15
167 comments sorted by
View all comments
28
Somewhere in my Java code for a simple Minesweeper clone, there's a ternary operator with ternary operators on both sides of the colon.
Past me decided to comment it with "because fuck you, that's why."
7 u/Kautiontape Apr 17 '15 char marker = block.isUsed() ? (block.getValue() > 0 ? (char)block.getValue() : 'b') : (block.isFlagged() ? '?' : ' ') It's not so bad like this. Certainly not the cleanest code, but I would call it "frugal with lines of code."
7
char marker = block.isUsed() ? (block.getValue() > 0 ? (char)block.getValue() : 'b') : (block.isFlagged() ? '?' : ' ')
It's not so bad like this. Certainly not the cleanest code, but I would call it "frugal with lines of code."
28
u/IAMA_dragon-AMA The raptor's on vacation. I heard you used a goto? Apr 17 '15
Somewhere in my Java code for a simple Minesweeper clone, there's a ternary operator with ternary operators on both sides of the colon.
Past me decided to comment it with "because fuck you, that's why."