Is it better for Discourse to use JavaScript or CoffeeScript?

Aside from the points that have already been discussed, I’ve noticed that writing Ember apps in CoffeeScript also just feels a little off. Several of the niceties of Ember, like computed properties, are expressed as extensions on the JS Function prototype:

MyApp.president = Ember.Object.create({
    fullName: function() {
      return this.get('firstName') + ' ' + this.get('lastName');
    }.property('firstName', 'lastName')
  });

This requires you to use parens in CoffeeScript, which kind of defeats the purpose of the significant whitespace:

MyApp.president = Ember.Object.create
    fullName: (->
     @get('firstName') + ' ' + @get('lastName')
    ).property('firstName', 'lastName')

In addition to that, there’s the CoffeeScript class vs Ember extend() stuff, CS iteration vs Ember enumerables, etc. I just think there’s enough of an impedance between using CS and using Ember to make it more appealing to just use pure JS with Ember.

4 Likes