Mark Wilden wrote:
> On Mon, Jan 26, 2009 at 7:23 AM, James Byrne <li...@ruby-forum.com> 
> wrote:

> 
> This has nothing to do with your question - just a style suggestion:
> 
>  effective_from <= time_now and (superseded_after.nil? or 
> superseded_after = time_now)
> 
> No need to use 'return'. And you don't want to check if superseded_after 
> is false - just nil (if it's false, there's a bug that would be hidden by 
> 'not superseded').
> 

I prefer the style of explicit returns.  It makes intent unambiguous. 
Your point wrt nil? is well taken and I have modified the code to use 
this idiom.
-- 
Posted via http://www.ruby-forum.com/.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to