Closed tamzinblake closed 12 years ago
One problem is that the preferred indentation level isn't obvious. In the following case, you want function bodies indented past the function keyword to be clear:
Crafty.load( ['sprite.png']
, function () {
Crafty.scene('main')
}
, function () {
foo()
}
)
But in most cases, you'll only pass one function to a function and it will look more like:
Crafty.load(['sprite.png'], function() {
Crafty.scene('main')
return DoLotsOfStuff + UseReallyLongNames * Makethisfunctionunreadablein80charwidth
})
So which indentation is correct, or how do we disambiguate between the two? Is the indentation difference just caused by whether the function keyword is on a different line than the opening brace of its parent?
it does:
Should be:
or: