Sidechat icon
Join communities on Sidechat Download
My teammate dead ass removed my one liner for this in our group project ….
165 upvotes, 9 comments. Sidechat image post by Anonymous in Computer Science. "My teammate dead ass removed my one liner for this in our group project …."
upvote 165 downvote

default user profile icon
Anonymous 14w

Wouldn’t rand # & mod combo compile faster than nextBoolean?

upvote 6 downvote
default user profile icon
Anonymous 14w

Crash out

upvote 5 downvote
default user profile icon
Anonymous 14w

Something I like doing is splitting the ternary operator over multiple lines. Best of both worlds. Like this: return random.nextBoolean() ? a : b;

upvote 5 downvote
default user profile icon
Anonymous 14w

was there any justification?

upvote 3 downvote
default user profile icon
Anonymous 14w

Didn’t even omit the else block 💔💔

upvote 3 downvote
default user profile icon
Anonymous 14w

His is more quickly understandable

upvote 1 downvote
default user profile icon
Anonymous 14w

The first line isn’t even that hard to understand and is a lot cleaner. Your teammate is crazy

upvote 1 downvote
default user profile icon
Anonymous replying to -> #2 14w

He didn’t see it he said

upvote 9 downvote
default user profile icon
Anonymous replying to -> #6 14w

The one liner is way quicker to read. I don’t think we should stop using ternary operators just because some people are too lazy to understand what they mean even though it’s ridiculously simple

upvote 4 downvote