From: swille Date: 2005-11-07T12:32:09+09:00 Subject: Re: programming best practices > > But the way you've written it, rc is always false. Did you mean true > in the first line? :-) > > Also, it seems a little bit like you've got two error-reporting > systems going on. Maybe you could combine them: > > def login > perform action > end > > begin > login > rescue > ... > end > > etc. > Ah, yes, that was a typo. My example possibly wasn't the greatest... I couldn't think of exactly when I had used it last in Ruby. It's actually something I've been using in Java quite a bit because I've been writing interfaces into JavaScript and there's no way (in JavaScript) to handle the exceptions from Java, so I use a boolean return value. I decided at some point that I really like the aesthetics of it. After a colleague questioned that behavior in another context though, I thought twice about whether it was a good idea. Basically, I suggested he use a boolean return value to a method and he said something to the effect that it would be more proper to return int-based return codes because "some_method true?" didn't sound right. I wondered if maybe I was going to regret not going to college :O)