Mark Twain once received a telegram from a publisher that read:
NEED 2-PAGE SHORT STORY 2 DAYS.
Twain replied:
NO CAN DO 2 PAGES 2 DAYS. CAN DO 30 PAGES 2 DAYS. NEED 30 DAYS TO DO 2 PAGES.
As his reply implicitly states, there are difficulties associated with short and concise writing—it’s not easy. I agree wholeheartedly. I think this same type of reality exists while programming in Ruby. I can get something working really fast, but (for me at least), it seems like I keep wanting to extract and refactor until the method is as small as it can possibly be. I could probably spend days trying to out-do my current code and get just as much satisfaction as if I were developing something new. I love how much you can do with one single line in Ruby. It’s motivational.
And for the record, I don’t apply the short and concise writing methodology here (obviously). This site just isn’t that sophisticated. But I can see the challenges and fun in that, too.
01
Chris on Sat Mar 10 at 06:19AM
Method chaining is probably my favorite feature in Ruby. Not only is it more concise, it’s more readable because the operations are read in the order they are written. There’s no doubt about it – I love Ruby :-)