this post was submitted on 04 Feb 2025
179 points (93.7% liked)

Programmer Humor

20441 readers
2200 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 

you are viewing a single comment's thread
view the rest of the comments
[–] brian@programming.dev 8 points 5 days ago (1 children)

found the following in our codebase the other day.

while(booleanFlag)
    return;

thhere wasn't more in the loop body, that was it. the loop conditional does exist and it can hurt you.

[–] rikudou@lemmings.world 4 points 5 days ago (1 children)

Can it hurt you, though? My guess would be every sane compiler and interpreter optimizes this.

[–] brian@programming.dev 3 points 4 days ago

the codebase readability certainly suffers, and this isn't the only case of shenanigans like this