4 ms·
I remember my first class. It was a Stopwatch. It had start, stop, reset, and read methods. It maintained an internal counter by calling time(2) or something li
by msg 18y ago
I remember my first class. It was a Stopwatch. It had start, stop, reset, and read methods. It maintained an internal counter by calling time(2) or something like that.
A lot of objects have no real-world equivalent (they are not "objective", I kill myself), but that doesn't make them useless.
Objects are an odd mash of concepts: inheritance, interfaces, global data with limited access, encapsulation, memory management. The object model will differ from language to language, and your objects will look different depending on what features you use.
You can program in a pretty object-oriented way in straight C. Some languages bend more easily to these ideas than others.
http://www.planetpdf.com/codecuts/pdfs/ooc.pdf http://www.planetpdf.com/codecuts/pdfs/ooc.pdf [pdf]