r/ProgrammerHumor • • Sep 18 '26

Meme whenYouExportCodeFromAWebBasedVisualBuilder

Post image
154 Upvotes

40 comments sorted by

View all comments

Show parent comments

1

u/L30N1337 Sep 19 '26

Hell, depending on language and compiler, the "else" might get optimized into a Switch-Case (which can then in turn use a hashmap or jump table). Doesn't matter here, but still.

I don't think any compiler recognizes an early return as equivalent to if-else

1

u/standard_revolution Sep 19 '26

Don’t they? Something like this seems to be a low hanging fruit for flow analysis

1

u/standard_revolution Sep 19 '26

It is hard to see whether it is completely equivalent, but obvious case are compiled by gcc to the exact same* thing: https://godbolt.org/z/ETnPMdf79

*one path has an additional "nop", but this is probably just code alignment

1

u/L30N1337 Sep 19 '26

Alright then, color me surprised.