Desert Code Camp: June 13th, 2009

by Michael F. Collins, III June 14, 2009 12:00

Still recovering from the events of yesterday, but Desert Code Camp seemed to be a success in my book. There are things that I would have liked to have done better, but with four presentations in the can, I’m pretty happy with how it all turned out.

I’m starting to go through the four hours and one gigabyte of screen recording video and audio that I captured yesterday. I did my first presentation this morning on Production Debugging, but the rendering process in Camtasia Studio is taking its sweet time, so it may take a while to get all of the videos up.

I had a great time at Desert Code Camp. I really enjoyed presenting and met a lot of great people. I was astounded by how many people showed up for my debugging sessions. I honestly had not expected those sessions to be as full as they were. There were not enough chairs for both sessions, so I had people sitting around the outside of the room and outside the door to listen in on the presentation.

Since the two debugging session were the most popular, I’m putting together their videos first. I will be publishing them here on my blog later this afternoon. If I have time, I’ll get the other two up as well, otherwise look for them to appear on Monday.

For those of you that attended my sessions, thank you for your attendance. This was my first time speaking at a Code Camp, and I’m looking forward to doing so again next time.



Tags:

Code Camp

Comments

6/14/2009 4:22:11 PM #

CSharpRox

I especially enjoyed the debugging sessions.  My coding process is going change from now on.  I am going to be more efficient.  Debugging code has always been something I enjoyed but I have to admit that stepping through the debugger was a distraction that has wasted a lot of my time.  I am excited about trying out some of the tools you went over and I'll probably watch the videos again.  @ CSharpRox:

CSharpRox United States

6/15/2009 12:21:21 PM #

CSharpRox

I loved the debugging presentations.  They were my favorites out of all the sessions.  

I was thinking about the relationship between inline Debug.Assert and TDD.  Should you use both or is that overkill?  I personally prefer using inline debug.asserts but every team I've been on has been against this.  The main problem I see with them is that ridiculous pop up that tells you an assert failed. Of course you can turn that off in your config file but what if it somehow gets removed?  

Not a single developer I know uses debugView and when I try to explain it and show it off I get little response (even though I use an awesome color-coding scheme).  They say, "we're already using the logging application block and anything more is just overkill".  This might be accompanied with "Besides, we're supposed to be doing TDD".  Yeah right.

I am wondering what your opinion is about this.

CSharpRox United States

6/15/2009 9:24:02 PM #

michael

@ CSharpRox:

(Sorry about your comment not appearing immediately. I get a lot of comment spam, so I leave moderation on for comments.)

I use Debug.Assert just about everywhere in my code. It's not really part of TDD, in my opinion. It's more about making sure that the code is used correctly, and trying to identify places where the code might fail. I pretty much never use Debug.Assert with my test code, instead using the Assert functions that come with the testing framework like NUnit, for example.

Take for example, when creating a method in .NET, the .NET library defines exception types such as ArgumentException or ArgumentNullException that you're supposed to raise if you receive a bad argument. The reason why I don't like this is that it seems like these exceptions are more for development time than production time. I'd rather receive a Debug.Assert error that indicates that a method is being called incorrectly by my code because there's more that I can do with it when I get the assertion error. I almost never implement a try...catch block for ArgumentException, so if the exception is raised it's going to cause my application to crash because of an unhandled exception. The only way that I'll know about the unhandled exception is if I log it, or if I capture a mini-dump to figure out that I'm calling a method incorrectly.

The difference is that with Debug.Assert, I get an immediate response that tells me exactly where the code failed and I can go in and fix it. Of course, this isn't going to help you in the release build because Debug.xxx methods will be conditionally ignored in a release build, so in that case you might want to follow up your Debug.Assert code with throwing the real exceptions later on in your code.

When it comes to debugging code, few developers really "get it." Most think of debugging as stepping through their code trying to figure out why the program is failing. But debugging is more defensive programming by giving yourself as many options as possible to figure out why the software might be failing, and using Debug.Asserts in lots of places means that you're ultimately going to have better software.

I also get a lot of push back on my teams on tracing and DebugView. It goes back to what I was saying about the difference between logging and tracing. Many people don't understand the difference between the two. Logging's more for operational monitoring, but tracing is for debugging.

I get a lot of questions from senior-level developers and architects asking why I want to put in tracing. They point out that it's not going to do much good when it's on a user's machine in production because nobody's going to ask the user to turn on tracing on their machine. I don't really buy that argument. Why is it so bad to ask them to do that if every other support option has been exhausted. It's another tool that may or may not be used. But most importantly, tracing provides value to me as a developer in supporting the software in production. If the user can't turn it on, I can turn it on when I'm running the software in my machine trying to reproduce their steps.

The best advice that I can give you is to keep doing what you're doing with DebugView and Debug.Asserts. Eventually, their value is going to prove themselves, and the developers that are questioning you will learn it when the software does fail in a production environment.

Michael

michael United States

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen | Modified by Mooglegiant

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

What I'm reading now


Add to Technorati Favorites

Disclaimer

The views expressed on this website/blog are the opinions of Michael F. Collins, III, and do not necessarily reflect the views of my employer.