<p>Which is better in general in terms of the ordering?  Do you put the fault condition at the top or bottom?</p>

<pre><code>if (noProblems == true) {
    // do stuff
} else {
    // deal with problem
}
</code></pre>

<p>OR</p>

<pre><code>if (noProblems == false) {
    // deal with problem
} else {
    // do stuff
}
</code></pre>

i like to eliminate error cases first - and return from the function early so that the 'happy path' remains un-nested, e.g.
```
```
if (some error condition)
{
    //handle it
    return;
}
//implicit else for happy path
...
```
```
if it is easy to identify the conditions leading to the happy path, then by all means put that clause first (thanks Marcin!)