Tonight, Rich, Marcel and I spoke at the DC Ruby Users Group. Instead of choosing a topic, preparing a set of slides, and droning on about something for an hour we decided to involve the group to help us answer a question. It’s a question I get a lot when I do training with The Pragmatic Studio: “Which Ruby projects should I look at to see examples of great Ruby code?”
I have my standard answers (I’m sure we all do), but two things occur to me about answering such a question. The first is that when asked a question like this, I have a gut reaction. There are names that spring immediately to mind. If I scrutinize these reflex reactions I realize that I haven’t really examined the code I’m thinking of in enough detail to call it great. So though I have some cursory knowledge that makes me pretty sure when I give my recommendations (I’m holding off on naming specifics so as to not influence your answer to this question), I’m not 100% sure which projects contain great Ruby code.
The second realization about this is that some of the names that spring to mind are based on potentially the wrong criteria. I, like all humans, am more likely to mention something popular than something obscure. There is also a Ruby community folklore. Some names are synonymous with “great”. But it’s just folklore. So the knee-jerk reactions are at risk of being heavily influenced by the Ruby popular culture. Looking at how successful popular culture is at picking great music, visual art, fiction, and other artistic mediums, it’s pretty clear that we shouldn’t trust pop culture when making decisions about which projects are composed of “great” code.
So we asked the DC RUG: “Who are the greatest Ruby programmers in the world?”
Then, all together, we looked at code written by the people they came up with.
Some of it was beautiful. Some of it was ugly.
We talked about what made some of it beautiful and some of it ugly. We talked about the importance of writing beautiful code. It was fun.
Anyway, I still don’t have a satisfactory list of great Ruby code. I’d like to build such a list. So, please leave a comment saying the name of an open source Ruby project you feel represents truly great Ruby code.
March 27th, 2008 at 01:19 PM
I think Admiteer is a nicely written application. Check out at http://admiteer.com/ . The source code is also available http://6brand.com/admiteer-your-online-ticketing-app
March 27th, 2008 at 03:09 PM
I can’t speak for greatness, but the prettiest ruby code I’ve seen in a while is Capistrano 2.
March 27th, 2008 at 03:31 PM
“We talked about what made some of it beautiful and some of it ugly. We talked about the importance of writing beautiful code.”
I’d like to read a more in depth summary of that conversation.
March 27th, 2008 at 05:21 PM
It is interesting to realize the fact that code that you like to use may not necessarily be the most beautiful code under the covers. Even more interesting is that you usually are only forced to look under the covers and be exposed to the beauty or lack thereof when you run into problems with the code. And in those cases it’s the horrifyingly bad code that you are more likely to notice; code that is readable often doesn’t sear itself into your memory the same way.
I’m pretty fond of the vlad internals. It’s not as well-documented as Capistrano, but I find that whenever I need to figure out how stuff works it’s very easy for me to dive in to the source and understand how it works at a glance.
I’ve also been pretty impressed with the simplicity found in the Rack code. It leverages basic things like hashes and lambdas in a straightforward way.
+1
March 27th, 2008 at 06:17 PM
Can you provide a list of the codes/gems that came up in the conversation at DC RUG?
I?d like to read a more in depth summary of that conversation.
+1
March 27th, 2008 at 08:44 PM
I’ve spent quite a while reading the code for core rSpec. Both the code and the architecture of what they achieved is quite nice.
March 28th, 2008 at 02:19 AM
Someone please start a hotornot- or kittenwar-type site for code snippets!
Or, maybe add such a layer to pastie?
Or point me at an existing one for code.
(Peter Provost and I hatched this little plan after participating in the Agile’07 workshop, Design Sense: Can We Teach Deep Design Skill With Perceptual Examples? hosted by Michael Feathers and Emmanuel Gaillot, but obviously neither of us launched such a site.)
March 28th, 2008 at 06:08 AM
Best in Show: http://code.google.com/p/orangutan/
I like that idea bil. I personally think some sort of extension to rDoc’ing to include #HACK or #GOTCHA tags would allow us to expose beautiful code without making a blogpost about it. ... and maybe harnessing the metadata of the context of that code? Maybe we can get Heroku.com to do it. They already host the code so people who use heroku don’t have the barrier of ‘exposing’ code to a new third party…
March 28th, 2008 at 08:02 AM
?The greatest artist?? This is the one of the unanswerable questions.
We can distinguish god from bad and mediocre art. To fully understand the greatness of an art one should deeply understand the whole process of genesis and historical context.
The art exhibition galleries and ?the hall of fame? are good way to see, enjoy and educate about the good and astonishing art.
March 28th, 2008 at 02:51 PM
Here, to me, is pure beauty + function: http://pastie.caboo.se/pastes/65758
Here’s why I think it’s such an awesome bit of code:All in all. Just awesome, beautiful, functional code without a real purpose :)
Thanks Chris – I still go back to this code, and it’s what I hand out to people to show them what awesome code is like.
March 28th, 2008 at 11:25 PM
@kastner: that’s slick; thanks for sharing.
March 29th, 2008 at 09:42 PM
I’ve just started looking at Merb. I’m shocked how well documented the code is. I highly recommend it.
March 30th, 2008 at 04:09 PM
Beautiful code is straightforward and battle-scarred.
Something that has ‘neat tricks’ and surprises you is not straightforward, and not beautiful.
March 31st, 2008 at 09:58 PM
You can tell a kind person not by how kind they appear but by how good they make you feel when you’re around them.
I think code is the same way. Code that says “hey, check me out – I’m awesome” is crap compared to code that says “what’re you doing there? Oh, let me help you with that.”
[ And thanks to Neeraj for the Admiteer plug :-) ]
April 10th, 2008 at 04:54 AM
3bxjrot-5el1qqi-tw6q18f5-0 auto insurance http://finance.groups.yahoo.com/group/term-life-insurance_/#1 health insurance[/url] [http://way.to/homeinsurance#5 home insurance] home insurance health insurance[/LINK]
April 14th, 2008 at 10:06 PM
Hi, here is my entry: http://martin.ankerl.com/files/e
Article about it: http://martin.ankerl.com/2006/08/11/program-e-extract-any-archive/
Ive been using this tool for almost two years now, and many other people like it as well. The beauty is that it is extremely simple yet powerful.
May 2nd, 2008 at 12:12 AM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 2nd, 2008 at 11:12 AM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 3rd, 2008 at 07:47 AM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 3rd, 2008 at 08:28 AM
Discount viagra online viagra https://www.blogger.com/comment.g?blogID=6157809498687416224&postID=2294246231227742229
May 3rd, 2008 at 03:19 PM
Cheap viagra online cheap viagra http://www.usapillscheap.com/ viagra[/url]
May 3rd, 2008 at 05:40 PM
Viagra pills online viagra online http://www.usaviagraonline.com/ online[/url]
May 4th, 2008 at 04:49 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 5th, 2008 at 06:46 AM
Alabama
May 5th, 2008 at 05:26 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 5th, 2008 at 05:26 PM
Cheap cialis online cheap cialis http://www.cialisusacheap.com/ cialis[/url]
May 6th, 2008 at 12:25 AM
Viagra pills online viagra online http://www.usaviagraonline.com/ online[/url]
May 6th, 2008 at 01:06 AM
Discount viagra online viagra http://digg.com/users/VIAGRAONLINEEE
May 6th, 2008 at 04:14 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 6th, 2008 at 09:23 PM
Viagra pills online viagra online http://www.usaviagraonline.com/ online[/url]
May 7th, 2008 at 08:07 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 7th, 2008 at 08:13 PM
Cheap cialis online cialis https://www.blogger.com/comment.g?blogID=513494629458774789&postID=5066463426249996410
May 8th, 2008 at 02:16 AM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 8th, 2008 at 10:33 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 9th, 2008 at 06:01 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 9th, 2008 at 06:19 PM
Discount viagra online viagra https://www.blogger.com/comment.g?blogID=2837938490592425442&postID=7939306939206631166
May 9th, 2008 at 11:39 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 10th, 2008 at 02:59 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 11th, 2008 at 02:39 PM
Discount viagra online viagra https://www.blogger.com/comment.g?blogID=463918176562845353&postID=4198372366535906527
May 11th, 2008 at 05:55 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 11th, 2008 at 06:22 PM
Discount viagra online viagra https://www.blogger.com/comment.g?blogID=463918176562845353&postID=4198372366535906527
May 12th, 2008 at 12:16 AM
I grew snapping and began names. living the vast crashing down for the even know plants sweet,
May 12th, 2008 at 12:16 AM
reaction about for the the dead pets green bag me snapping and we School planted night yes global
May 12th, 2008 at 02:15 AM
parents I don’t know him. I’d hoped years later. along as proud and began I noticed
May 12th, 2008 at 02:16 AM
Behind by themselves boy juicy me car ugly leaves I know about names. all juicy sea joke
May 12th, 2008 at 12:57 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 12th, 2008 at 01:27 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 12th, 2008 at 01:48 PM
Discount viagra online viagra http://www.mixx.com/users/LOWEST_VIAGRA_PRICE_GUARANTEED
May 12th, 2008 at 05:03 PM
Viagra pills online viagra online http://www.viagrausaonline.com/ online[/url]
May 12th, 2008 at 05:55 PM
Discount viagra online viagra http://www.mixx.com/users/LOWEST_VIAGRA_PRICE_GUARANTEED
May 12th, 2008 at 08:30 PM
Cheap cialis online cialis https://www.blogger.com/comment.g?blogID=3251352651752616462&postID=6079312996982939051