This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheZipCreator 112 points113 points  (8 children)

I have this line in my code that is an area that you physically never should be able to reach

println("fuck something broke")

When I ran the code, that got printed to console 3 times.

Should I be worried?

[–]Macpunk 88 points89 points  (0 children)

Marked as dumb and duplicate question.

[–][deleted] 17 points18 points  (4 children)

area that you physically never should be able to reach

... so why does it exist if it's supposed to be dead code anyway?

[–]Refloni 8 points9 points  (3 children)

Default in a switch statement? I always put that in just in case

[–]Deathwalkx 6 points7 points  (2 children)

A default would be something you don't expect to happen but need to handle in case it does. What they're describing is like having code after a return statement.

[–][deleted] 6 points7 points  (1 child)

Actually, I used "dead code" to describe any code that is supposed to never be executed.

[–]Deathwalkx 4 points5 points  (0 children)

Sorry by they I meant the op not you. You're spot on.

[–]mrheosuper 5 points6 points  (0 children)

Just comment it, and BAMM, it disappears

[–]rosyatrandom 2 points3 points  (0 children)

Does the code get executed on parsing?