The principle the above commenter refers to is known as &quot;Easier to Ask Forgiveness than Permission&quot;, i.e. you&#x27;re not meant to check preconditions – you should just try to do whatever thing you want to do, and it should signal an error if it didn&#x27;t succeed.<p>The reason for this has little to do with &quot;clean code&quot; and more to do with the fact that when checking preconditions, programmers have a tendency to check proxies rather than the actual thing they want to do. An an example, it is common to see the following:<p><pre><code>    if not file_exists(filepath):
        stderr(&quot;Invalid config filepath!&quot;)

    config = read_file(filepath)
    ...
</code></pre>
This code has the glaring problem that even if the file <i>exists</i>, that doesn&#x27;t mean you have the required permissions to read it. What you really want to do is read the config file, but you check a proxy (does the file exist at all?) as your precondition.<p>How would you check for the right thing, that you can read the config file? Well, by trying to read the config file, of course!<p><pre><code>    try:
        config = read_file(filepath)
    except IOError:  # can make this more fine-grained
        stderr(&quot;Invalid config filepath!&quot;)
</code></pre>
This is longer code (one extra line, gasp!) but it avoids the problem of checking the wrong precondition which is so easy to do by mistake.<p>You may have heard of this concept in a different situation – e-mail validation. A lot of people go to great lengths to validate e-mail addresses by regex. Even if the address is perfectly conforming and passes the regex with flying colours it might not lead to an inbox. To really verify that the user can receive e-mail at the address they&#x27;ve specified, guess what you have to do? Send an e-mail and ask them to confirm they got it. It&#x27;s the only way.