Learning Ruby - Day 12

13 Apr 2005 in Programming, Ruby on Rails, Teach Yourself Ruby in 21 Days by Garrick

Day 12 - When repeating yourself is the preferred method is repeating yourself.

Today’s topic is recursion - iteratively calling a function numerous times with a single minor change. On face value, it sounds like something computer technology should help us avoid. In addition, it seems to directly conflict the Ruby on Rails mantra Don’t Repeat Yourself. Though recursion is inherently resource intensive (repeating yourself over and over is often tiring), the prime benefit seems to be highly concise code without resorting to loops or iterators. Yeah, this is alpha-geek stuff.

All snarkiness aside, Slagell is positioning recursion as a tool to help clearly define the necessary action at the smallest level and using recusion to focus.

I should probably read this chapter again.


This post documents my journey through Sam’s Teach Yourself Ruby in 21 days. I’ll be joining Al Abut in his effort to learn Ruby and blog along the way.


Comment | Trackback URL Short Link:

Comments (1 Comment)

No real comment, but I just wanted to thank you for writing about your ruby learning process. I’m following along and do appreciate the effort you’re making to document it. It motivates me to read the chapters when sometimes I don’t want to.

Thanks!

MikeInAZ added these pithy words on Apr 14 05 at 10:59 pm

Add a Comment


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Related Entries




Creative Commons License
About Sitemap XHTML Sitemap XML
Wordpress theme is a heavily hacked version of "Modicus Remix" by Art Culture. Original by Upstart Blogger