It’s all about CoffeeScript (and quietly about Ruby).
Why do people feel the need to remove punctuation? I came across the following code snippet:
class TenFarms.View extends Backbone.View constructor: -> functions = _.difference _.functions(this), _.functions(TenFarms.View.prototype) _.bindAll.apply _, [this, "render"].concat(functions) super
What I like and dislike – in line # order
- Nice, define a function.
- The beef
- GOOD – Sure you don’t need “var”
- BAD – Why no parens around _.difference(_.functions(this), …)
- Again, we’re depending on whitespace to cause things to happen.
- Think about this is: “A B” a function call? What About “A B, C D” – did I forget a comma or is that two function call “A(B, C(D))”
Bottom line, is when I’m reading Ruby or CoffeeScript I’m driven somewhat batty by when a function call happens. All because they dropped the (…) requirement and now have some ambiguous cases. Part of me has to wonder sometimes if the heavy emphasis on TDD is because of the adoption of such programming languages.