zerotohero-dev / o2.js

A Coherent Solution to Your JavaScript Dilemma
http://o2js.com/
Other
74 stars 11 forks source link

multi-line guard clauses take too much space. #93

Open v0lkan opened 12 years ago

v0lkan commented 12 years ago

Compare this

    if (arguments.length < 2) {
        return;
    }

    if (!obj) {
        return;
    }

    if (!isObject(obj)) {
        return;
    }

versus this

    if (arguments.length < 2) {return;}
    if (!obj                ) {return;}
    if (!isObject(obj)      ) {return;}   

The latter one is better, I guess.

We should update the conventions document and go over the source code to reflect the changes.

josecapablanca commented 12 years ago

working on it right now.

josecapablanca commented 12 years ago

did it.

v0lkan commented 12 years ago

closing this one.

josecapablanca commented 12 years ago

re-opening this. -- because conventions document is not yet updated.

plus, I have a bunch of stuff to add to the conventions document too.