Ether.Sysu <zs****@yeah.net> wrote:
At last, i use class Type's member function InvokeMember(...) to invoke
the private function.
By the way, the code i'm going to test is written by myself. If test
the code by tracing it step by step(F11 in visual studio 2003) is a
good habit?
There are people who swear by tracing through the code line by line
manually. I far prefer unit testing, because it means when I've changed
one bit of code I don't need to run through *everything* manually
again.
I only use the debugger when something isn't working as I expect it to,
after thinking about it for a while. Apart from when I'm investigating
the behaviour of someone else's library, I regard needing to go into
the debugger as a bit of a personal failure. That's not to say it's not
invaluable when you get to that stage, but I tend to think that if what
the code does isn't obvious just by looking at it, then I've got a bit
of a problem beyond it not working properly.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too