This version of Vestibule is read only. It represents an archive of the community effort to produce content for Ruby Manor 4.

The pleasures of Ruby in Javascript

updated over 4 years ago; latest suggestion over 4 years ago

That great things can be done with Javascript shouldn't blind us to its foibles. How much effort does it take to get the pleasures of Ruby while writing JS?

I'll go over

  • common Ruby idioms, and how to safely port them to Javascript
  • enumerations, splats
  • metaprogramming in Javascript
  • things you don't realise you can use now - getters, setters
  • what's coming up in ES6


  • 2abf5beb51d5d66211d525a72c5cb39d Paul Battley suggests over 4 years ago

    I don't think you should let the fact that CoffeeScript exists deter you from talking about how to do these things in plain old JavaScript.

    Perhaps you can even demonstrate that CoffeeScript is unnecessary!

  • The proposal author responds over 4 years ago

    The talk would be 'pure' Javascript - maybe touch on the DOM re fixing up a few prototypes.

    Coffeescript does make a lot of the arcana around building in missing language features less important. With it being a default in Rails perhaps most Rubyists are now Coffeescripted up?

    If so the talk could be refocussed around metapgrogramming - how to do method decoration, mixins, class methods, how similar the prototypical object system is to Ruby's etc.

  • Acd62030df551952268e84c8fff26a5b James Adam suggests over 4 years ago

    Will your examples be using "pure" javascript, or will they be operating on semi-realistic DOMs?

    As I understand it, Coffeescript does some of the work of making Javascript feel more Ruby-ish. Do you have any thoughts about this that might be worth including in your presentation/proposal?