From: Lyle Johnson Date: 2002-08-21T08:51:09+09:00 Subject: Re: What makes a "good" Ruby extension? Tim Hunter wrote: > So I'm reading the "Comparing Gui Toolkits" wiki page > (http://www.rubygarden.org/ruby?ComparingGuiToolkits) and I notice that > the author characterizes one of the Ruby interfaces as "Perl-like" and > another as "immature." As someone who's been busy beavering away at his > own Ruby interface to an existing C library for some months now, I'm wondering, > just what makes a "good" Ruby interface? (After all, I don't want to > embarrass myself by offering a bad one to the Ruby community :-) I think this is a question that a lot of Ruby programmers struggle with, especially if they've come to Ruby after a long history with some other programming language. Despite efforts like this: http://www.rubygarden.org/ruby?RubyStyleGuide there's not really a "checklist" out there to compare your work to (and I don't think anyone wants that anyways). Perhaps your best bet, then, is to study Ruby code that *others* have pointed to as exemplary of "The Ruby Way". That certainly includes looking at the sources from Ruby's standard library, but a lot of code from the Ruby community falls into this category as well. For example, many people have pointed to Sean Russell's REXML library: http://www.germane-software.com/software/rexml as a very intuitive (read: "Ruby-like") interface. I hope others reading this thread might throw in their $0.02 about other good examples (for my benefit ;) > Going by my own standards for software, I'm assuming that a good Ruby interface should be: > > 1) usable, that is, not buggy, reasonably efficient, and predictable > 2) complete, that is, provides a complete interface to whatever it's interfacing with > 3) documented, (no point having an interface that you can't figure out) and > 4) supported, so you have some hope of getting bugs fixed, etc. Well, yes. I guess those things are important too ;)