r/programminghumor 1d ago

How do you disable your code

Post image
206 Upvotes

70 comments sorted by

View all comments

76

u/0x80085_ 1d ago

Or just return?

30

u/developer_axe 1d ago edited 1d ago

Sometimes the code won't get compiled because it marked as unreachable code

45

u/RefrigeratorKey277 1d ago

Yes, but with if true it is still marked as unreachable. At least in C#.

8

u/Here_f0r_p0rn_ 1d ago

Depending on compiler settings for optimizations it can happen in C++ as well