From: James Britt Date: 2006-06-04T03:12:25+09:00 Subject: Re: Where can one find examples of masterful Ruby code? Christian Neukirchen wrote: > James Britt writes: > > >>Semi-rhetorical questions: If you are not already well-versed in >>Ruby, how do you know you are reading masterful code? >> >>If you are reading masterful code, can one appreciate what makes it >>masterful without a firm knowledge of Ruby? > > > I'd say that I'm pretty well-versed in Ruby. I have not yet seen much > masterful code. I'm not sure I could point out a medium-sized piece > of Ruby that's *truly* and *completely* masterful. Sure, the "Quality > Without A Name" turns up here and there, but I just don't find > something that is completely soaked with it. Maybe I just have too > high expectations. Prove me wrong, please. The code I've seen that struck me as masterful (insert all the usual caveats about judgment, qualifications, etc.) tended to be short, crisp, and fairly easy to understand. Sometimes there was an "Ah ah!" moment in grokking the code. Most code, though, seems focused on getting a job done, which makes perfect sense. So I don't expect to find files filled with line after line of masterful code; I think it more likely that the more skilled Rubyists will write a collection of relatively short, clear methods that make it easier to write the rest of the code needed to accomplish a particular task. So most of the code appears, at first, quite mundane, until you realize how much *more* mundane code would be required were it not for these enabling methods. There may be analogies to furniture making, where a piece may not strike you as especially masterful until you poke around and see how the hidden joints were constructed, and how they enable a design that in other, less-skilled hands, would never be stable. > > >>Is the definition of "masterful" conditional? If so, on what? > > > Does masterful code get less and less the more you advance? > Does masterful code only exist in languages you don't know that well? > (I somehow feel like there is plenty of masterful Haskell code out > there...) It may be like music, where the more one knows and the more one has heard, the harder it is to get excited about new music (though when you do find something good, it can be *really* exciting). -- James Britt "I often work by avoidance." - Brian Eno