Comments on: How are you reading? Hi Fredrik, I find this subject interesting. Since you asked, I'll share: When I read code, it's usually during a debugging session. I place breakpoints at important locations, and let the callstack explain how it got there. I'll copy & paste important callstacks into UltraEdit (or Notepad++) when I need to remember them. In my current project there is a lot of asynchronous event passing, so often a sequence of events will require several callstacks to understand it. During these debugging sessions, I constantly check the state of memory in the Watch window. It helps to have a good expression visualizer (autoexp.dat). I'll often insert the values of important variables into those callstacks pasted into UltraEdit, to remember more context. And I'll use a data breakpoint to know for certain who is changing a value. In this way, I spend almost as much time reading data as reading code. In extreme cases, I'll have to bust out a pad & paper to keep track of the spiderweb of data structures in our engine. This kind of data visualization can be pretty helpful for understanding the algorithms. Usually, I draw diagrams of actual <i>data</i>, and not diagrams of classes/types -- UML diagrams seldom make much sense to me. Source browsing tools like Intellisense and Visual Assist X (in Visual Studio) are helpful for locating definitions. They're supposed to help locate references, too, but unfortunately, this has not worked super reliably for me in recent projects. (I heard VS2010 has made good strides in this department, but we still use VS2008 on my team.) Therefore I usually rely on live debugging, or fall back on "Find in Files". Thanks for the article. Cheers! Hi Fredrik,

I find this subject interesting. Since you asked, I’ll share: When I read code, it’s usually during a debugging session. I place breakpoints at important locations, and let the callstack explain how it got there. I’ll copy & paste important callstacks into UltraEdit (or Notepad++) when I need to remember them. In my current project there is a lot of asynchronous event passing, so often a sequence of events will require several callstacks to understand it.

During these debugging sessions, I constantly check the state of memory in the Watch window. It helps to have a good expression visualizer (autoexp.dat). I’ll often insert the values of important variables into those callstacks pasted into UltraEdit, to remember more context. And I’ll use a data breakpoint to know for certain who is changing a value.

In this way, I spend almost as much time reading data as reading code. In extreme cases, I’ll have to bust out a pad & paper to keep track of the spiderweb of data structures in our engine. This kind of data visualization can be pretty helpful for understanding the algorithms. Usually, I draw diagrams of actual data, and not diagrams of classes/types — UML diagrams seldom make much sense to me.

Source browsing tools like Intellisense and Visual Assist X (in Visual Studio) are helpful for locating definitions. They’re supposed to help locate references, too, but unfortunately, this has not worked super reliably for me in recent projects. (I heard VS2010 has made good strides in this department, but we still use VS2008 on my team.) Therefore I usually rely on live debugging, or fall back on “Find in Files”.

Thanks for the article. Cheers!

]]>
By: Matthew Weigel/2011/06/23/how-are-you-reading/#comment-6253 Matthew Weigel Thu, 23 Jun 2011 18:47:04 +0000 :-)

]]>
By: Fredrik Alströmer/2011/06/23/how-are-you-reading/#comment-6250 Fredrik Alströmer Thu, 23 Jun 2011 17:30:14 +0000 And it used to be too, I have no idea how it got botched. Thanks for pointing it out, I've corrected it. And it used to be too, I have no idea how it got botched. Thanks for pointing it out, I’ve corrected it.

]]>
By: Matthew Weigel/2011/06/23/how-are-you-reading/#comment-6245 Matthew Weigel Thu, 23 Jun 2011 16:14:59 +0000 ). I had some difficulties with it. That said, it does let you browse calls TO a function or class method (inasmuch as it can determine), but I’ve found static analysis like that is insufficient anyway… so I just rely on carefully-constructed find+grep aliases. :-)

]]>
By: Mikhail Glushenkov/2011/06/23/how-are-you-reading/#comment-6243 Mikhail Glushenkov Thu, 23 Jun 2011 15:25:51 +0000

]]>