Starting Ruby, and the Little Details
Posted: 2 years ago (2007-11-03 21:15:06 UTC ) / Updated: 15 months ago (2009-06-01 22:29:24 UTC )
Imported from WordPress
Originally posted on 2007-11-03 21:15:06
In my quest to conquer the world, I'm documenting a bunch of my thoughts during the silly Ruby stuff I'm doing. I never did with my older DGD MUD library or documentation site and I regretted it.
This isn't my very first foray into Ruby, but it's my first serious project. That means I'll discover all sorts of lovely little Ruby-isms along the way. I go back now and then to retrofit my code with them.
Once I got past simple test code and basic Ruby syntax, I started finding little things about the language that bug me -- every language has them. For instance, Ruby has a "require" statement which loads in a file, and if you load the same file with multiple require strings, you get it multiple times. The same file could be loaded as "variable.rb", "../lib/diffeq/variable.rb", "diffeq/variable.rb", and wind up being included three separate times, doing everything the file instructs it to three separate times. You could add a C-style "set this variable to indicate that you've already done this" thing, but then what's the use of having an "only require once" statement in the first place?
A number of my minor irritations with Ruby seem to be shared by other people, which indirectly led me to the Extensions project, and then to its successor-in-spirit, the Facets project. Ruby, like, Perl, has a lot of little supplemental libraries to do all sorts of things that the language doesn't. Perl's Comprehensive Perl Archive Network is (mostly) mirrored in Ruby's RubyForge, which is expanding quickly enough to start giving CPAN a run for its money.
Something I like about Ruby is that I get the impression that the Ruby community, and Ruby's initial author Matz, are still looking for the True Ruby Way. Some of my little irritations with the language are still being fixed up, as neat Rubyisms from various frameworks get merged into the language proper a few at a time, and new little features are tried out and (sometimes) included.
A lot of Ruby feels that way -- people are good about accepting new ideas and using each other's contributions. The latest release of Facets absorbs a lot from the now-unmaintained extensions library, the Newgem library for making library releases builds heavily on hoe, and so on.
I've always had trouble quantifying things about user communities -- what makes DGD's central cadre so different from Perl's, or Python's, or Io's? But Ruby has one more thing that I really like, and that's a user community that just feels good. The people are helpful, the ideas are creative, and there seems to be a real feel for good library design and often decent software engineering. They like reuse and unit testing, and they actually do a fair amount of it. The people at the center seem to be extremely competent, but that's common. What's uncommon is that the rank-and-file Rubyists just seem to do neat things with it, and to have a good attitude while they do so.
And that's awfully hard to beat.
