10 May '12, 1pm

Read between the lines

May 10, 2012 Tagged: lines of code metrics Comments (View) Read between the lines People frequently use lines of code as a metric. How many times have you heard someone say, “it’s only 10 lines?” or “This class is almost 200 lines?” Have you ever heard somebody boast that they could write something in fewer lines of code? Do you talk about your test to code ratio? How many lines of code something takes doesn’t tell us much about the code. Let’s take a closer look at some better metrics. Complexity Focusing on lines of code encourages developers to jam as much complexity as they can into each line. Compare this example: def credit user && coupon = user.coupons.where(:product_id => product.id).first.try(:amount) || 0 end To this one: def credit user && user.coupon_for(product).amount || 0 end # On User def coupon_for(product) coupons.where(:product_id => product.id).first.tr...

Full article: http://robots.thoughtbot.com/post/22777096999/read-betwee...

Tweets

'My other #Ferrari is a boat' great read from @...

howtospendit.com 09 May '12, 3pm

Welcome to howtospendit.com, the Financial Times' new luxury lifestyle website. For 15 years, How to Spend It, the FT’s mu...

"This is definitely a testament that people still read,”

"This is definitely a testament that people sti...

theurbanwire.com 09 May '12, 7am

While e-book sales are outstripping their non-digital counterparts, the 84,000 books traded in Book Exchange 2012 on April...

Email Lines That Make Me Rage,

mrbrown.com 09 May '12, 7am

When @jovenatheart tweeted: "it makes me #rage when i see emails saying 'for your advise'", I knew I had to start #EmailLi...

@jcroft I'm just reading between the lines. "Mo...

sass-lang.com 11 May '12, 6pm

It is now possible to define a custom importer that can be used to find imports using different import semantics than the ...

My Mum Can Read Minds

My Mum Can Read Minds

akiraceo.com 12 May '12, 4am

Sorry for the slow update over this week. I have been kinda busy. What a coincidence!!! My mum said the exact thing I thou...

thank you @annewwy for the lovely read: #bersih

malaysianbar.org.my 11 May '12, 7pm

1,270 Members of the Bar attended the Malaysian Bar’s Extraordinary General Meeting (“EGM”) held at Sunway Putra Hotel on ...

Triathlon has come a long way since that first ...

triathlon.org 10 May '12, 3am

San Diego - the birthplace of triathlon By Nicola Hargreaves on 09/05/12 at 11:21 pm This weekend presents a rare opportun...

Just read @chadfowler's again. Good stuff.

chadfowler.com 10 May '12, 12pm

Dead-End Jobs: Are You Suffering From Stockholm Syndrome? December 30, 2010 Have you heard of Stockholm Syndrome? It’s a n...

What has writing code got to do with dating? Re...

nushackers.org 11 May '12, 5pm

Long overdued, and only my third post here. So as some people know, I built Instasyncer a while ago, partially for fun, bu...

Obama

ace.mu.nu 12 May '12, 6pm

As leader of the free world President Obama will be used to making speeches to millions of people around the globe. So he ...