Ban The Debugger
iancartwright.com
iancartwright.com
So, yes please, have some failure cases setup ahead of time, and send the logs to the developers and see if they can figure out which failure mode it was without getting any live access to the program. But don't call it "banning their debugger." :-)
A debugger infrastructure can be a core and critical component within a non-trivial application. This whether the integrated debugging is used for classic application debugging, for call tracing and basic performance monitoring, for creating and then processing application dumps on severe errors, for associated tasks including crash notifications and restarts and failure-related statistics collection, or otherwise.
You build debugging in. From the onset.
One OS environment that I work with can launch the system's debugger entirely under program control, which means the application can detect an "unexpected" failure and can (barring cases of severe corruptions) invoke application-specific debugger command sequences which can access and display the core application context, and a debugger-readable dump then be generated, and (if appropriate) the application then restarted.
Logs never have enough data, and users (and programmers) don't always find and read logs. Better still, you don't have to switch techniques when you ship code; you're always using your primary tools. Bake debugging right into all non-trivial applications.
It seems like there are other ways to achieve the same end that the author is seeking.
ASP has only gotten away with it's bizzaro architecture and shitty implementation because it got such a full-fledged debugger for free.
I still want my debugger though.
How my team tries to fix the problem of log files being insufficient is to have debug builds log to the console as well as to the log file. If we have useful log statements in place, debugging a simple problem becomes trivially easy as we can see the problem unfolding in front of our eyes. This also helps solve the problem of logging too much data, because the more we log the more console spew we have to deal with.
I do like the idea of banning the debugger right before a launch, though.
I consider the desire to use a debugger a bug in my logging and take corrective action.
Also, you can't grep an execution history in a debugger. I really have no idea how you would spot systemic errors without doing so.
Can anyone who lives by debuggers make a case to convince me to fire up the debugger more often?
If a running program is like a lab rat running through a maze in the dark, then using print statements is like placing bells on tripwires in select places in the maze. Using a debugger is like turning on the lights, and watching the rat.
Log files are like attaching medical imagers to the maze and keeping a trace of it's physical and mental state as it executes the maze. Debuggers are like attaching medical imagers to the rat and being able to only see the immediate state only.
Obviously, debuggers are much faster to bootstrap than good logging, and in that category I can see them being a clear win. However, I still see them as providing less information.
PS: That said, there are a few situations I bust out a debugger too. Mostly when I'm too lost to get started.
I've been on both sides of that particular fence. On the one hand, learning to use a fancy development tool effectively takes time and effort, and that's time and effort that often can't be used to understand what's going on under the covers. And then you're stuck learning about the inner workings anyway when something fails to build with some kind of vague error message.
But in the long run the automation provided by high-level development tools makes for more productive programming, and the time spent learning to use them is usually paid back handsomely.
My advice would be to do a few projects using little more than command-line tools (and no project templates), but then don't get stuck in a rut and do take the time to learn how to automate things and generally make your life easier with higher-level tools.
With debuggers in particular there are classes of bugs where logging (or worse, Response.Write/echo/puts debugging) is pretty ineffective: if an integer is being interpreted as a string where you expected a number, printing out the value in a log file doesn't give you much insight into what's going wrong.
I would say that developers should be logging anyway, and reading the logs in addition to using their debuggers.
"The most effective debugging tool is still careful thought, coupled with judiciously placed print statements." -- Brian Kernighan
and followed it up with
"Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?"
If you waste your time on debugger, then you will have just bug fixed and nothing else.
If you invest your time into code, you will have bug fixed AND much better code.
Computers can catch bugs much faster than humans. Programming is invented for that. Think like you already have programmable debugger inside your program. Invest your time into useful tools, which you can use to trace and check your program.
edit: I work at a place like this.