244
you are viewing a single comment's thread
view the rest of the comments
[-] jcg@halubilo.social 2 points 2 months 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 2 months 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
244 points (98.8% liked)

Programmer Humor

37265 readers
28 users here now

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

Rules:

founded 6 years ago
MODERATORS