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

Programmer Humor

20735 readers
372 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
[–] [email protected] 8 points 2 weeks 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.

[–] [email protected] 4 points 2 weeks ago (1 children)

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

[–] [email protected] 3 points 2 weeks ago

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