top | item 9672465

(no title)

bjones22 | 10 years ago

As someone who played around with building Isomorphic games in HTML5, well done. The API is fairly clean, and the examples are solid (although the examples link in the README is broken).

Quick question though, as someone who might use / submit a pull request to this project...

Why coffeescript over ES6? As someone who used to use coffeescript for everything, and has since switched to ES6/7, I see coffeescript heading out the door. Not to mention that compilation to ES5 gets quite convoluted with coffeescript, which could lead to performance issues / weird bugs that force you to drop into raw ES5 anyways.

Awesome project, great work!

discuss

order

coroutines|10 years ago

In regards to Coffeescript over ES6, I still turn to CF for these:

1) postfix conditionals 2) list comprehensions (will probably be in ES7) 3) the .litcoffee format 4) use of -> or => for defining functions unbound/bound to `this` 5) python-escue whitespace (i love it) 6) array slicing (some_array[3 .. 8]) 7) regular expresions defined on several lines (expanded for readability) 8) friendly "item in some_array" that translates to .indexOf() condition 9) @value becomes this.value 10) The existential operator? is awesome. 11) () -> a = 1 b = 2 return { a, b } # becomes: { a: a, b: b }

There are others... I very much enjoy the syntax coffeescript has for its for loops. for value in some_array for value, key in some_array for key of some_object for key, value of some_object for own key of some_object for own key, value of some_object # for-of uses Object.hasOwnProperty()

Coffeescript just needs a for loop form that works with iterators, then I will be happier. I can write in Coffeescript and distribute both that and the compiled JS, no problem. This feels comfortable to me. I hope was ES6 becomes common that Coffeescript's class syntax will "fall through" to the same ES6 way underneath.