From: Florian Frank Date: 2004-10-07T00:29:12+09:00 Subject: Re: quality of error messages On 06.10.2004, at 16:49, Joachim Wuttke wrote: > But: > (1) the system should tell me which method in the above > chain causes the problem Actually it does. > (2) as a naive programmer, with a background in other languages, > I do not think of pos as method. I think of it as variable. > Once the system does not find a method, it could check whether > there is a local variable of same name, and then print out > an error message like > "no method 'pos', no read access to local variable 'pos'". You should think of it as a method. That's called the Uniform Access Principle. It's true that almost all of the so called OOP languages get it wrong, but that doesn't mean that Ruby should join them. Consider that you change the implementation of your class and "pos" isn't a variable (field) anymore but computed instead. In some other languages you now have to change all the client code that directly accesses the variable. That's exactly the opposite of data hiding and encapsulation of state. Florian Frank