The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Third Day of the Craftsman Swap

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jake Scruggs

Posts: 336
Nickname: aurorae314
Registered: Feb, 2008

Jake Scruggs is a developer at ThoughtWorks
Third Day of the Craftsman Swap Posted: Apr 15, 2009 8:01 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jake Scruggs.
Original Post: Third Day of the Craftsman Swap
Feed Title: Jake Scruggs
Feed URL: http://jakescruggs.blogspot.com/feeds/posts/default
Feed Description: Ruby, Rails, Metrics, Testing, and pursuit of clean code.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jake Scruggs
Latest Posts From Jake Scruggs

Advertisement
Day Three of the Craftsmanship Swap:

Micah and Paul had to head out of town for an Iteration Planning Meeting/Demo so it was just Colin Jones, Eric Meyer, and I in the office. We decided to do some tri-ping pong development on an internal product 8th Light is planning to release soon. So Eric would write a test/spec, I'd make it pass and write another spec, then Colin would make my spec pass and write one for Eric and the whole process would repeat. An enjoyable way to work made easier by their 24inch Cinema Displays and wireless keyboards.

I've noticed that everybody shakes hands at 8th Light. A lot. When someone arrives in the morning the new person tends to shake the hands of all who are already there. The same thing happens when someone leaves for the day. I asked Colin and Eric about the origins of this but they had no answers for me. It seems kind of weird, but it's also sort of a cool affirmation of camaraderie. It may just be better than the grunt I give people when they leave for the day.

At some point I found myself arguing for these lines of Ruby today:

return false unless coupon = Coupon.find_by_token(session[:coupon_token])
return coupon.active?

Instead of a 5-6 lines of if/else code. Have I become the very person I despised when I got into Ruby? That guy who can't rest until lines of code have been reduced to unreadable terseness? Even inject doesn't look so bad to me anymore...

Of course, if we were using a current version of Rails we could do this:

!!Coupon.find_by_token(session[:coupon_token]).try(:active?)

Now that's teh hotness.

Read: Third Day of the Craftsman Swap

Topic: Ordered Hashes, In Ruby 1.9 and Javascript Previous Topic   Next Topic Topic: I Am Machine Tag And So Can You

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use