Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Neon, or how I stopped hating the prototype and loved the class

chubas
September 05, 2012

Neon, or how I stopped hating the prototype and loved the class

For the Ruby GDL lightning talks on 5/9/12

chubas

September 05, 2012
Tweet

More Decks by chubas

Other Decks in Programming

Transcript

  1. The philosophy is that it should not try to emulate

    other languages, so it preserves the JavaScript good parts, but with a nicer syntax to create classes that ensure interfaces and include reusable functionality as modules.
  2. Class(Breezi.UI, 'Button').inherits(Breezi.Widget)({ ELEMENT_CLASS : 'ek-button', prototype : { label :

    'button', init : function(config){ var button = this; Breezi.Widget.prototype.init.call(this, config); this.element.bind('click.button', function (e) { button.dispatch('click', { originalEvent : e }); }); } } });
  3. Does not replace Javascript Just useful to wrap around your

    mind, but you still have to learn Javascript. Just the good parts!