From: "Hal E. Fulton" Date: 2002-07-07T03:33:16+09:00 Subject: Re: to pass or to be? ----- Original Message ----- From: "Tom Sawyer" To: "ruby-talk ML" Sent: Saturday, July 06, 2002 1:08 PM Subject: to pass or to be? > so i have a question realted to class inheritence: when a class inherits > from a superclass, is it good coding practice for the superclass to use > the childs instance variables? or should they be passed? for example: I suggest: class A def initialize(x) @x = x puts x end end class B < A def initialize super("hello world!") end end > i don't know why but i tend feel like its cool for the subclass to look > up at the superclass, but not for the superclass to look down. it just > seems funny, but i can place why. so i'm wondering what others think. I agree. It increases the coupling, for one thing. Hal Fulton