TRE: Ruby Idioms for Rails
Stuart Halloway gave a talk on Ruby idioms for Rails. He started off his presentation by talking about implicit vs. explicit, and rewriting a Java Struts method to an equivalent RoR method. It was actually quite humorous, he was basically able to get rid of most of the statements in the Java method, and condense things down to just a few concise and easily understandable lines of code.
Bottom line: Rails has an implicit API, whereas Struts (for example) has an explicit API
He went on to discuss the dangers behind the immense power of Ruby, such as dynamically injecting new functionality to classes or aliasing methods. I wholeheartedly agree, as I’ve been bitten by things like that before, too.
Finally, he made a call for refactoring common Ruby/Rails idioms into more abstract ‘helper methods’ (not sure if that’s the right term), to improve readability, keep things DRY and make future changes easier.
Technorati Tags: rails, therailsedge


