Re: Using the debugger with local variables was Re: is this badly written code?
Re: Using the debugger with local variables was Re: is this badly written code?
- Subject: Re: Using the debugger with local variables was Re: is this badly written code?
- From: "I. Savant" <email@hidden>
- Date: Tue, 15 Apr 2008 14:40:53 -0400
> These simplistic examples (creating a URL from a string)
> will work the same no matter how many times you execute them, but a lot of
> real code isn't that simple.
Well *THANK* you, John! ;-) Indeed as I was finishing up that
sermon and packing up my soapbox, I thought of the many shortcomings
of using string assignment and appendage (is that the right word?) but
I trust my meaning was clear.
Your example is better - something I hadn't thought of. Something as
simple as -[myWidget explodeHamster] is clearly destructive to your
Hamster* which may hinder future debugging attempts. Perhaps even
better is -[myHamster multiplyEyesByTheTimeOfDay:] ... how many eyes
did your hamster have before? That's easy enough to see in the
debugger. How many will it have now? Well probably more (or less at
and just after noon or midnight) than it had before, that's for sure
...
The point is, for debugging, nothing is easier than seeing (at a
glance) your variable and its value in a convenient list in your
debugger and being able to modify that (to see what happens if your
hamster has twenty-eight eyes and the time is given in 24-hour mode
versus 12-hour for that particular trip through your for loop.
--
I.S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden