You are viewing davemauldin

davemauldin

> Recent Entries
> Archive
> Friends
> Profile

April 8th, 2008


05:59 am - How I feel about Ruby sometimes...
I feel just like this... really often, actually...

http://www.oreillynet.com/ruby/blog/2007/05/ruby_academically_viable.html#comment-607691

"Why? It gives some programmers serious wood."

Maybe it's because I'm older now and more interested in clarity, low complexity and getting things done. Unless there's a productive reason to compromise any of those items, then I'm not going to.

I think this guy has the right idea:

http://www.oreillynet.com/ruby/blog/2007/05/ruby_academically_viable.html#comment-612840

"I believe you can work around most rubyisms without any trouble."

This does make me ask the question, why should we have to work around them?
Current Mood: discontentdiscontent
Current Music: Beat Blender on SomaFM

(Leave a comment)

April 1st, 2008


05:18 am - Rubyisms
Which is easier to read?

{:start_date => params[:start_date], :end_date => params[:end_date]}.each do |k,v|
# do something here
end

vs

for k, v in {:start_date => params[:start_date], :end_date => params[:end_date]}
# do something here
end

It makes sense from an OOP perspective to call a method on the object that returns what you want, but I think using the for statement is much clearer when reading through the code. You can just skim through and still get what's going on there.

Why does everybody recommend using the .each method? How/why did that become "The Ruby Way"?
Current Location: Home
Current Mood: contemplativecontemplative
Current Music: Boom Boom Satellites

(Leave a comment)


> Go to Top
LiveJournal.com