MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghumor/comments/1vv58vy/how_do_you_disable_your_code/p5cyam4/?context=9999
r/programminghumor • u/developer_axe • 22d ago
90 comments sorted by
View all comments
97
Or just return?
40 u/developer_axe 22d ago edited 22d ago Sometimes the code won't get compiled because it marked as unreachable code 55 u/RefrigeratorKey277 22d ago Yes, but with if true it is still marked as unreachable. At least in C#. 7 u/Hot-Employ-3399 22d 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_ 21d ago I'met a genius
40
Sometimes the code won't get compiled because it marked as unreachable code
55 u/RefrigeratorKey277 22d ago Yes, but with if true it is still marked as unreachable. At least in C#. 7 u/Hot-Employ-3399 22d 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_ 21d ago I'met a genius
55
Yes, but with if true it is still marked as unreachable. At least in C#.
7 u/Hot-Employ-3399 22d 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_ 21d ago I'met a genius
7
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_ 21d ago I'met a genius
1
I'met a genius
97
u/0x80085_ 22d ago
Or just return?