Getting Up and Running
12/02/09 19:00 Filed in: Meetings
For the very first meeting, we met at Maggiano’s to discuss debugging practices. There was no formal lecture this time around - we had a dinner discussion led by the Big Nerd Ranch’s Jeremy Sherman. Here’s a collection of tips, links, etc. that were mentioned:
+ Take an index card, and write down the last three mistakes that you know you made. For the rest of the coding session, each time you come across something that isn't working right, attack those three possible causes first.
+ Learn about the Low Level Virtual Machine, particularly its 'scan-build' functionality. The LLVM is an infrastructure designed to help with low-level optimization of programs written in a variety of languages.
+ Check out the book Debugging by David J. Agans. The book lays out several rules for identifying, resolving, and preventing mistakes. "Unlike most books about debugging, this book isn't a technical manual. It's easy to follow and logical approach and progression." -- IEEE Software magazine
+ Using conditional NSLog statements and keeping your run log open when testing can provide an invaluable amount of information about what's going on. Using TextExpander, you can easily and very quickly insert NSLog templates into your code, even placing the caret right where you want it for seamless editing.
+ Unit testing is an oft-discussed but underused technique. Unit testing allows you to debug your code in much smaller chunks as you build your application, allowing you to identify immediately what has broken as the result of an added feature or class.
+ It's imperative that you know your system. Take a moment to review (again) the simple-but-forgettable features of your compiler, language, and target: operator precedence, memory management, etc. Operator precedence, for example, is reviewed on p. 478 of Kochan's book.
+ One particularly useful resource for understanding memory management is a video course at the Mac Developer Network.
+ GDB - the GNU Project Debugger - can be an immense help. There's a steep learning curve, as it uses its own syntactical command structure, but those that have begun using it regularly swear by its benefits. Xcode's debugger has built-in GDB command support. GDB as it relates to coding on the Mac is extensively discussed in Chapter 6 of Advanced Mac OS X Programming, written and published by Mark Dalrymple and Aaron Hillegass of the Big Nerd Ranch.
+ You can add a category to NSObject that overrides the autorelease method - with this, you can add extra NSLog statements to help you monitor and report the statuses of your objects.
And here are a few more that were submitted by email after the meeting...
Michael Ledford sent some links to blog posts about debugging:
http://cocoawithlove.com/2008/10/debugging-tips-for-objective-c.html
http://wilshipley.com/blog/2008/07/pimp-my-code-part-15-greatest-bug-of.html
http://www.clarkcox.com/blog/?p=12
http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html
Brian Hardy recommends the following blogs:
Jeff LaMarche - author of "Beginning iPhone Development" - http://iphonedevelopment.blogspot.com/
More "edgy" iPhone stuff - http://iphonesdkdev.blogspot.com/
A good block on thwarting iPhone crackers: - http://thwart-ipa-cracks.blogspot.com/
Erica Sadun - author of the iPhone Developer's Cookbook - http://ericasadun.com
Ars Technica's Infinite Loop Blog - more general apple stuff, but occasional programming things: - http://arstechnica.com/apple/
And for those into Rails programming, Alex Silverman recommends:
http://iphoneonrails.com/
+ Take an index card, and write down the last three mistakes that you know you made. For the rest of the coding session, each time you come across something that isn't working right, attack those three possible causes first.
+ Learn about the Low Level Virtual Machine, particularly its 'scan-build' functionality. The LLVM is an infrastructure designed to help with low-level optimization of programs written in a variety of languages.
+ Check out the book Debugging by David J. Agans. The book lays out several rules for identifying, resolving, and preventing mistakes. "Unlike most books about debugging, this book isn't a technical manual. It's easy to follow and logical approach and progression." -- IEEE Software magazine
+ Using conditional NSLog statements and keeping your run log open when testing can provide an invaluable amount of information about what's going on. Using TextExpander, you can easily and very quickly insert NSLog templates into your code, even placing the caret right where you want it for seamless editing.
+ Unit testing is an oft-discussed but underused technique. Unit testing allows you to debug your code in much smaller chunks as you build your application, allowing you to identify immediately what has broken as the result of an added feature or class.
+ It's imperative that you know your system. Take a moment to review (again) the simple-but-forgettable features of your compiler, language, and target: operator precedence, memory management, etc. Operator precedence, for example, is reviewed on p. 478 of Kochan's book.
+ One particularly useful resource for understanding memory management is a video course at the Mac Developer Network.
+ GDB - the GNU Project Debugger - can be an immense help. There's a steep learning curve, as it uses its own syntactical command structure, but those that have begun using it regularly swear by its benefits. Xcode's debugger has built-in GDB command support. GDB as it relates to coding on the Mac is extensively discussed in Chapter 6 of Advanced Mac OS X Programming, written and published by Mark Dalrymple and Aaron Hillegass of the Big Nerd Ranch.
+ You can add a category to NSObject that overrides the autorelease method - with this, you can add extra NSLog statements to help you monitor and report the statuses of your objects.
And here are a few more that were submitted by email after the meeting...
Michael Ledford sent some links to blog posts about debugging:
http://cocoawithlove.com/2008/10/debugging-tips-for-objective-c.html
http://wilshipley.com/blog/2008/07/pimp-my-code-part-15-greatest-bug-of.html
http://www.clarkcox.com/blog/?p=12
http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html
Brian Hardy recommends the following blogs:
Jeff LaMarche - author of "Beginning iPhone Development" - http://iphonedevelopment.blogspot.com/
More "edgy" iPhone stuff - http://iphonesdkdev.blogspot.com/
A good block on thwarting iPhone crackers: - http://thwart-ipa-cracks.blogspot.com/
Erica Sadun - author of the iPhone Developer's Cookbook - http://ericasadun.com
Ars Technica's Infinite Loop Blog - more general apple stuff, but occasional programming things: - http://arstechnica.com/apple/
And for those into Rails programming, Alex Silverman recommends:
http://iphoneonrails.com/