Vaguery + metaprogramming   4

fingernails in oatmeal, Metaprogramming: Ruby vs. Javascript
"To be honest, there’s not much to say about the Javascript example because it is so simple. We avoid the whole metaclass business because Javascript uses prototypal inheritance. This means that Javascript does not distinguish between classes/prototypes and instances and, therefore, we can add our desired behavior directly to the instance. We use the exact same technique for adding a method to the prototype, but this time we simply add the function directly to the instance. Again, this function is a closure. And again, this function has access to the instance’s state using this.…
Closures are so ingrained in the language’s design that metaprogramming seems to happen without even trying. This little exercise has left me very excited about the potential of Javascript not only as a great language for the web, but also as a powerful server-side language. You should be excited too."
metaprogramming  javascript  ruby  OOP  scripting  tutorial  comparison 
march 2010 by Vaguery
rubigen
"A framework to allow Ruby applications to generate file/folder stubs (like the rails command does for Ruby on Rails, and the ‘script/generate’ command within a Rails application during development)."
Ruby  generator  software-development  distribution  automation  user-experience  metaprogramming  coding  gem  via:thetrek 
november 2009 by Vaguery
Ruby Best Practices - Fun with Class.new
"I think you’ll agree that this second sample induces the kind of familiar sugar shock that Ruby coders know and love. It accomplishes the same goals and actually wraps the lower level code rather than replacing it. But is there some sort of dark magic behind this? Let’s peek behind the curtain:..."
programming  Ruby  metaprogramming  tips  Nudge 
may 2009 by Vaguery

Copy this bookmark:



description:


tags: