Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 17
    Don't think for a minute that mistakes are the domain of junior programmers. 95% of developers of all levels of experience goof something up once in awhile. The remaining 5% are lying through their teeth. Commented Nov 2, 2013 at 17:09
  • 59
    If I saw someone write code that checks for a null and silently fails, I'd want to fire them on the spot. Commented Nov 2, 2013 at 17:10
  • 19
    Stuff failing silently is pretty much the worst. At least when it blows up you know where the explosion occurs. Checking for null and doing nothing is just a way to move the bug on down the execution, making it far more difficult to track back to the source. Commented Nov 3, 2013 at 0:28
  • 2
    +1, very interesting question. In addition to my answer, I'd also point out that when you have to write code who's purpose is to accommodate a unit test, what you're really doing is trading increased risk for a false sense of security (more lines of code = more possibilities for bugs). Redesigning to use references not only improves the readability of the code, but also reduces the amount of code (and tests) that you have to write in order to prove that it works. Commented Nov 3, 2013 at 1:54
  • 7
    @Rig, I'm sure that there are appropriate cases for a silent fail. But if someone puts silent fails in as general practice (unless working in a realm where it make sense), I really don't want to be working on a project they are putting code in. Commented Nov 3, 2013 at 22:59