extends keyword instead of <superclass ... >

Dmitry A. Soshnikov dmitry.soshnikov at gmail.com
Sat Mar 26 14:31:51 PDT 2011


Just a small note on 
(reading currently)

Why not just to use already reserved `extends` keyword for specifying a 
superclass? These XML-like braces looks not so elegant.

Coffee users the same classes syntactic sugar as planned for ES6: 
http://jashkenas.github.com/coffee-script/#classes and also reuses 
familiar (for all?) `extends` keyword of ES3.


This (XML-like syntax) relates also to other meta-properties/attributes 
in object initialisers. I prefer to use @ instead:

let foo = {
   @proto: bar,
   move: # (x, y) {

Though, again, e.g. Coffee (on Ruby's style) users `@` for `this`. Does 
JS need this sugar for `this`? In this case (since # is planned to be 
used actively) meta-properties can be:

let foo = {
   #proto: bar,
   move: # (x, y) {


More information about the es-discuss mailing list