From: Ryan Davis Date: 2012-01-20T06:46:45+09:00 Subject: Re: Beginner Questions On Jan 19, 2012, at 09:13 , T.J. L. wrote: > Here is a link to what I have: > > http://codepad.org/mx5Qheyr > > I'd really appreciate any guidance someone can offer. Honestly, when you write code that looks like this: > def saveDB > File.open( $fn, 'w' ) { > # note the extra line with the massive amounts of trailing whitespace... > |f| > f.write($col_array.to_yaml) > f.write($totaltime.to_yaml) > } > end my brain stops reading almost immediately. Your indentation, parenthesis, inconsistencies, and general styling all detract from the readability of the code to the point where it's hard to see the forest through the trees. Here is idiomatic ruby: def save_db File.open $filename, 'w' do |f| f.write $dives.to_yaml f.write $total_time.to_yaml # tho, this is entirely redundant and could be recalculated end end 2 spaces per indent, snake case, no parens except as needed, real names. Drop whatever language you're coming from __completely__. Embrace ruby.