This post originated from an RSS feed registered with Ruby Buzz
by Adam Green.
Original Post: The community responds
Feed Title: ruby.darwinianweb.com
Feed URL: http://www.nemesis-one.com/rss.xml
Feed Description: Adam Green's Ruby development site
I knew that my coding style would strike people as un-Rubylike. I code like the dBASE programmer I have been for 25 years. What I didn't know is how they would respond. So far I've received 4 emails on my getparam.rb program, and all of them have been helpful and polite. What a relief. I've worked in some tough language neighborhoods in the past. The worst was in the late Eighties when the Clipper faction of the dBASE community felt that the only way they could distinguish themselves as "real programmers" was to attack the rest of us as stupid and lazy.
The responses ranged from alternative ways of parsing the .yml file to suggestions for using the built-in Yaml library. I had looked at this library, but couldn't find any docs on getting started. One respondent sent me a link for docs as well. Here is the simplest version using YAML.rb:
One part of Ruby style I still find hard to adjust to is the lack of a return statement. I know it isn't needed since the last value will be returned anyway, but I still find myself looking for it when reading code. This exercise is about becoming a Ruby programmer, however, so I'll try to adapt.