Is there any specific difference between these conditions?
1)
begin
acct = 1
return 0
end unless self.l_acct.nil?
2)
unless self.l_acct.nil?
acct = 1
return 0
end
From stackoverflow
-
Yes; the former is bad practice, the latter is not. They both accomplish the same thing.
Andrew Grimm : Bad practice because it's harder to read?Johannes Gorset : @Andrew Grimm: Yes, exactly.
0 comments:
Post a Comment