Skip to content

Instantly share code, notes, and snippets.

@to
Forked from Constellation/test014.js
Created March 27, 2011 20:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save to/889608 to your computer and use it in GitHub Desktop.
Save to/889608 to your computer and use it in GitHub Desktop.
// 僕こうかな…けっこう一貫してないけど
// 先頭近辺での揃えのスペースがすごく少ないな
if ((
cond_a || cond_b ||
cond_c || cond_d) || cond_e) {
}
test(
value1, value2,
value3, value4);
// 揃えのスペースはどの環境でも同じに見えるように空白で
var obj = {
prop : 'value',
key : 0,
}
// 関数名変わったらずれてるよ!!!
test1234(value1, value2,
value3, value4);
// 僕も上でプロパティ名は揃えてたくせに…。
// たぶん揃える対象の揃い度で分かれてるのかな。
// コードを揃えてきれいにというよりは、
// ブロックでダンダン置いていってる感覚ですね。
// きれいに揃えるとつらいというか。
// だいたいの位置に収まってるといいかんじです。
// 話それるけど、コードの縦横の延びや比率は気になりますね。
// けっこう軽く読めるように1行短く縦長に持っていきたかったり。
// MochiKitの折り返し。こんなんだったらタブでいいのにな。
isArrayLike: function () {
for (var i = 0; i < arguments.length; i++) {
var o = arguments[i];
var typ = typeof(o);
if (
(typ != 'object' && !(typ == 'function' && typeof(o.item) == 'function')) ||
o === null ||
typeof(o.length) != 'number' ||
o.nodeType === 3 ||
o.nodeType === 4
) {
return false;
}
}
return true;
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment