236
you are viewing a single comment's thread
view the rest of the comments
[-] jcg@halubilo.social 2 points 1 week ago

Huh, I had never considered this solution to fizzbuzz to be honest. I usually go for string concatenation, or (i % 3 == 0 && i % 5 == 0), but yeah i % 15 == 0 is certainly a clever simplification

[-] Bogasse@lemmy.ml 2 points 1 week ago

I think it's worse at conveying the intention and should be a compile-time simplification (I'm too lazy to check if compilers would do it though).

this post was submitted on 09 May 2025
236 points (98.8% liked)

Programmer Humor

35796 readers
63 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS