# BROKEN
func 5, {
event: (e) ->
if e.something
36
else
45,
val: 10}
Anyone with more than a day's experience with CoffeeScript knows that it's much better to express this with the simpler: # far better
func 5,
event: (e) ->
if e.something
36
else
45
val: 10
Note how just dropping the excessive notation makes the intention clearer while also making the code cleaner.His example on variable capture neatly illustrates a few of the opinions of CoffeeScript that actually make it far easier to reason about code: don't use global variables, and if a variable has the same name, it should refer to the same thing. It's far more confusing to allow rampant variable shadowing. Code that relies on variable shadowing is simply broken.
His last example shows a fundamental misunderstanding of not just CoffeeScript, but JavaScript generally. Granted `this` binding can be sometimes confusing, which is why CoffeeScript has a fat arrow (`=>`) to automatically capture `this`.