Friday, April 25, 2008

Conditional Breakpoints

Ok. I finally got my hands on VS08 and I hope, by the end of this week I can have some useful information to pass along. Meanwhile, here is a subject that's often unknown by most programmers, since VS is a huge tool and has a lot of features: conditional break points. While not cannon to the development process, this feature can help you to create a very complex and robust debugging ground for your application.

The idea is simple, after you create break points in the desired code lines, you can say when this breakpoint is supposed to actually pause the debug instead of doing it every time you reach that line. The process of creating a condition to your breakpoint (from now on, we'll use BP to name it) is easy. You simply create your BP, then right click it and select condition, a condition sentence window pops up and you can write the sentence to dictate the actual breaking. There are two sentence types for you to choose from: one that will return a Boolean value, and when the sentence is true, the BP will pause the process, or one that keeps an eye on when the sentence return value is changed, in which case the BP will too pause the execution. Simple enough right?

So when is this useful? Well, when you are testing a loop which has been breaking due to one specific element. Recently I've been writing code to parse a text file and turn it into a bunch of XMLs. So far it seems trivial, but the thing is that each text file has about 50Mb and generate up to 750 XML files of up to 15Mb each. So my loop was running for a while and each iteration involved a big number of methods intricate in the class hierarchies. I had the information that it was breaking in the 19th iteration of the 128th element. So instead of creating cluttered code to break the execution on that iteration, I just used a conditional BP with a sentence that would return true when those and a few other conditions were true and surely enough, problem solved.

This simple feature helped me save a lot of time debugging and prevented me from leaving trash code that I could forget to remove once the defect was corrected. BPs have a few other interesting and powerful features such as hit counts (which enables you only break when the hit count is either equal to, multiple of or greater than or equal to a user defined number), filters and when hit (used to define a course of action when the BP is hit).

So, I hope this will help you debug your applications faster, more robustly and more precisely.


Monday, April 21, 2008

Visual Studio 2008

In the past few days, I've been trying to install the new version of one the best IDEs ever made, Visual Studio. After being to a few presentations on the new Framework and the 2008 version of the IDE so I've been looking forward to trying out the new features of both.

I've got a DVD with the installers but it was corrupted so hopefully next week I can have more interesting news to share. I'll try to get a new DVD in the next few days so that I can try it out with a couple tutorials and so.

Until then, regards!


Friday, April 11, 2008

Introduction - so who is this guy and what's he talking about?


Well this is the first break I got from my current project so I thought I'd give the blog a go.
First things first, so let me present myself.

My name is Guilherme Bertini Boettcher and I'm currently a .NET Developer for Stefanini, allocated to Dell. I have a BS background and I've been involved in research for most of my professional life. My fields of work range from IT to information retrieval and information visualization. I am the maker of Many Eyes' Tag Cloud along with Matthew McKeon, who was my mentor during that project. I also created an IM History visualization, Ambhis, which uses information present in MSN history files to create an abstract self portrait of the user.

I'm currently working on Invoicing solutions for Dell using VB and .NET. My favorite programming languages are C# and Java and I'm currently pursuing certifications on those.

Now for this space.
This blog is designed to bring to you, fellow reader, information about my projects and whatever technology news I find interesting and have an urge to share.

So, lets all hope for the best and remember feedback is never too much, so please let me know what's on your mind.
Regards all!