From: Brian Candler Date: 2010-09-17T22:26:32+09:00 Subject: Re: Use of ? in variable names Todd Benson wrote: > I suppose because any object is true nil and false are objects too. You can probably argue that flag variables could be called 'foo?', but it's more difficult to argue for a variable called 'bar!', which you'd need for consistency. I can think of one minor advantage of not allowing local variables to end with ? or ! - Ruby unambigously knows that the token is a method, which improves the error message. >> a = 123 => 123 >> a? NoMethodError: undefined method `a?' for main:Object from (irb):3 from :0 >> b NameError: undefined local variable or method `b' for main:Object from (irb):2 from :0 -- Posted via http://www.ruby-forum.com/.