RS>> Sounds like sloppy programming to me, but then I'm very new
RS>> to the C++. I feel that IO cleanup should be done explicitly.
PG> Actually, this is quite within the spirit of C++. In fact, doing
PG> anything else is considered sloppy programming by
PG> some people, including
PG> Bjarne Stroustrup, the original designer of C++! In fact, if you do
RS> Hmmm... I find it fascinating the way some of the rules have been
RS> changed. The concept of constructors and destructors does feel
RS> natural and right to me. I seem to need to examine each thing that
RS> I have learned about procedural programming and apply it to C++
^^^^^^^^^^^^^^^^^^^^^^
RS> to find out what is different.... what works and what does not.
Wrong answer, Roger. ;-) C++ is an an OBJECT-ORIENTED programming language.
(Technically, purists claim it isn't that OO, but it does endeavor to be a
realistic OO language - i.e., one that works at a reasonable speed.)
Objects are supposed to take care of themselves. You send "messages" to it
(call its member functions), but let them handle their details. It's similar
to an abstract data type in C, except that you don't need to explicitly
"close" the data type.
---
---------------
* Origin: Tanktalus' Tower BBS (1:250/102)
|