[Edu-sig] Explaining Classes and Objects
Scott David Daniels
Scott.Daniels at Acm.Org
Mon Jun 13 18:16:12 CEST 2005
Kirby Urner wrote:
> Based on my working with Bernie, I think it's helpful to start early with
> the class/object distinction....
> rectobj = Rectangle(...)
> rectobj.setWidth(10)
> rectobj.draw()
>
A useful note here: all programmers are _used_ to using objects:
The file for I/O is an OS-defined object (without the nifty syntax
in such cases). OO provides (A) a way to define abstractions that
behave like the file abstraction yourself, and (B) a way to (at
least sometimes) define an abstaction that is "just like that other
abstraction except." Until you have A, B doesn't make sense. B
is hard to teach in that you need to go slowly -- the changes made
by inheritance take a while to "get."
--Scott David Daniels
Scott.Daniels at Acm.Org
More information about the Edu-sig
mailing list