From: Phrogz Date: 2006-11-26T01:05:07+09:00 Subject: Re: coding practise sempsteen wrote: > Thanks for your replies Gareth and Paul. > I've improved return statement as you suggested Paul. > this didn't worked: > return self == t2 and self != t1 > but this: > return (self == t2 and self != t1) > and this: > self == t2 and self != t1 > worked. The first didn't work due to the very low precedence of the 'and' operator. This should work: return self == t2 && self != t1 Although (living with Lua these days) I like the english 'and' and 'or' operators better than their C-style && and || counterparts, in Ruby I advise using && and || exclusively, or else be prepared to start slapping parentheses all over the place.