this post was submitted on 04 Feb 2025
184 points (94.2% liked)

Programmer Humor

22246 readers
676 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
184
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 8 points 1 month 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 1 month ago (1 children)

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

[–] [email protected] 3 points 1 month ago

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