News for hackers. Stuff that matters.
Re:Ask HN: Things you wish you'd learned about programming i... by weaksauce on Sunday November 29, 2009 @08:36PM (#967178)
I think he should amend his statement to be learn how to use your debugger of choice.

I think printf is a fine tool for some things. GDB others, the IDE's version of a debugger as well for some tasks, re-looking at the code in question another time is another way. It should not be a holy war and there is never a completely correct way to do multifaceted tasks such as debugging. Knowing the strengths and weaknesses of the tool at hand is the best way to increase your effectiveness.

I am hacking on a kernel driver right now and printf(well IOLog) is the easiest way to debug but if I was running in userspace I would probably use the xcode interface to GDB because it lets you zero in on what you want to look at with state but sometimes printf is all I need.

Re:Ask HN: Things you wish you'd learned about programming i... by duskwuff on Sunday November 29, 2009 @08:54PM (#967195)
What says you can't use GDB on the kernel? You'll need two machines to use it, but there's support in Darwin for debugging over FireWire.
Re:Ask HN: Things you wish you'd learned about programming i... by weaksauce on Sunday November 29, 2009 @09:07PM (#967205)
I never said you couldn't. I said the easiest(least amount of hassle) way is to use IOLog and my brain for debugging purposes.