[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: baby steps



>> Some quick comments from the peanut gallery.

Thanks for the help!
Sorry it took me so long to reply, but I've also added some functionality
to the code in addition to trying to fix the bugs you found.  These
additions should be posted shortly under the heading "BS tutorial ver
0.0.2"

>> 1) Virtual destructor are generally a good thing if you are deriving
>> classes.
>> 2) You might also want to make display and blit virtual.

Could you briefly provide some insight into how/when/why virtual should be
used in C++?  I know that my knowledge (and probably others) is very shaky
on the subject.

>> 3) In graphic why did you have the comment /* these should be protected?
*/
>> You probably don't want people arbitrarily modifying Width and Height
>> so yes.

Correct.

>> If you want to allow people to view width and height create
>> an inline member variable.

Done.
I've tinkered with the classes a bit so that the member variables and their
privileges seem more sensible, see what you think.

>> 4) Your destructor for graphic and descendants leak memory.  With the
way
>> you allocated it you destory it like:

Ouch, my mistake.  This should (hopefully) be fixed now.

5) (Minor note) Whitespaces (and even comments) don't kill people.
But oooh, are they painful!!! :)

Thanks again for your comments,
Brett