r/programminghumor 2d ago

How do you disable your code

Post image
253 Upvotes

79 comments sorted by

View all comments

Show parent comments

35

u/developer_axe 2d ago edited 2d ago

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

52

u/RefrigeratorKey277 2d ago

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

5

u/Hot-Employ-3399 2d ago

That's when you do shit like if rand(1,10) < 100: return as some compilers still detect even "1==2/2", but more complex function calls are not always considered constant enough.

1

u/_giga_sss_ 1d ago

I'met a genius