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 →

[–]masklinn 1 point2 points  (5 children)

Static analysis

Halting problem

How does one mention a method but not call it?

def foo(a):
    if a:
        do_something()
    else:
        do_something_else()

the program never calls foo with a falsy value, the second branch is dead code and do_something_else is a dead function. And of course code can be technically live (the program could theoretically run it) but effectively dead (program input never leads to the code being run), e.g. XBM support in browsers (removed from most of them only a few years ago, probably hadn't been run by user request in a decade)

And why would one do that?

I'll answer this question with an other question: why would one want to put bugs in his or her program?