thanks for the responses - sorry I didn’t reply sooner, we were away for the weekend.
This isn’t really a technical “how do I do this” question as much as one about whether anyone has done something like this before and if there are existing modules that are available.
I know how to use, and use regularly, breaks into the debugger. And in fact, all the information I need is in the debugger, yes. But it is a bit clunky in some scenarios, especially if you have to dig around looking for something.
What I am suggesting is not about display of debug information in a production version, though I could see that being handy in some cases. What I’m talking about is different - a way to discover an issue before you discover the effect of a bug on your application’s behavior. Let me explain:
There are situations where seeing realtime feedback in your UI as you’re using it can help you find thing you might not find otherwise. In my world (film and video), a VTR will display that kind of feedback in the form of error messages or alerts, or will light up LEDs that indicate something is functioning as expected or that there’s an issue.
In a more abstract way, our film restoration software has a “red only” mode, where it will display the footage you’re restoring very faintly in the background, with bright red pixels anywhere there was a fix applied on top of the background image. This is insanely useful in finding false positives that the software caught and “fixed” that aren’t actually defects in the picture. Doing at least one pass through a film in this mode is part of our standard operating procedure for film restoration, because it works so well. What I’m talking about here is conceptually similar to that.
For example, you may not notice that the value of a variable is being incorrectly set (or not set at all), if it’s then being correctly set somewhere else in your code, just after that. By the time you drop into the debugger you may have missed the bit where it wasn’t set. If that variable is being used by some other part of your application, it may not be immediately obvious in the debugger that the value is incorrect.
When you drop into the debugger and you step through your code, you do not necessarily see what’s happening in the UI as you step through the code. Yes, all the steps happen but it breaks the natural flow of using the application, so you are interacting with the app in a different, more methodical way (which has its place of course). But that may not be conducive to discovery of some bugs.
This happened to me on Friday, when I set my custom debug window to show me the value of a key variable as I was working on one issue. Turns out I’m not setting it in a particular loop like I had intended to, but it was masked because it was being set to a value in a later step. I only noticed it because the debug window I use, which happened to be tracking that variable at the moment, flashed a different value and it caught my eye. That was unrelated to the bug I was tracking down, but I was able to fix two things because I was able to see that the problem was there. I probably wouldn’t have noticed it otherwise, at least not until I wrote code that accessed that variable in that weird interim state.
I came into programming through software QA, and with no programming or CS background. I worked for a company where my job was to use their software as a user would, because I had a background in film and video, and the software was a major editing system at the time. So my approach is probably a little different, but still worthwhile, I think. A visual “control panel” of the state of my application that I can see at runtime would be immensely useful to me.
What I’m imagining is actually pretty simple: A window that contains a nested tree view of all variables and objects in an application. You can expand any section of that tree view and it remains open while you’re using the app, so that you can see what’s happening in that specific part of the code while you interact with the UI. Basically like taking the debugger’s variables pane out of the debugger and sticking it in your app, and having it update in real time as you use it.