Yik Yak icon
Join communities on Yik Yak Download
My teammate dead ass removed my one liner for this in our group project ….
165 upvotes, 9 comments. Yik Yak 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 16w

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

upvote 6 downvote
default user profile icon
Anonymous 16w

Crash out

upvote 5 downvote
default user profile icon
Anonymous 15w

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 16w

was there any justification?

upvote 3 downvote
default user profile icon
Anonymous 15w

Didn’t even omit the else block 💔💔

upvote 3 downvote
default user profile icon
Anonymous 16w

His is more quickly understandable

upvote 1 downvote
default user profile icon
Anonymous 15w

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 16w

He didn’t see it he said

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

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