I've often written this sort of function in both formats, and I was wondering if one format is preferred over another, and why.



public void SomeFunction(bool someCondition)
{
    if (someCondition)
    {
        // Do Something
    }
}


or

public void SomeFunction(bool someCondition)
{
    if (!someCondition)
        return;

    // Do Something
}


I usually code with the first one since that is the way my brain works while coding, although I think I prefer the 2nd one since it takes care of any error handling right away and I find it easier to read

I prefer the second style.  Get invalid cases out of the way first, either simply exiting or raising exceptions as appropriate, put a blank line in there, then add the "real" body of the method.  I find it easier to read.