by okertanov · 14y ago · 0 comments
Example 1
class Dog def speak return 'woof' end end
class Dachshund < Dog end
fido = Dachshund.new fido.speak => 'woof' Example 2
class Foo def bar return 123 end end
class Baz < Foo end
qux = Baz.new qux.bar => 123 Which example conveys more information? Which is easier to quickly grasp? Which would you rather read?
No comments yet.