I'm on the pro-debugger side, also 15+ years of developing NetBeans experience. I usually run the modules I wrote with debug action rather than simply run.

It is easier for me, to check different aspects of the runtime and en-charting unknown territories in NetBeans. Also fix class action is very useful as long as you do not introduce incompatible class changes.

The startup penalty of debugging is not really noticable if you are using hotspot vm (J9 is crawling in debug mode). Actually as I'm running on weekly dev releases, I'm running my main IDE in debug mode enabled, so I can attach a debugger to it  if I notice something odd. (And yes the attached debugger is running in another NetBeans session)

On 8/6/20 12:12 AM, Tim Boudreau wrote:
I've been developing NetBeans itself and plugins for it for 21 years now.
In that time I have run a debugger against NetBeans maybe ONCE, to see if
it worked.

The startup time penalty, and the odds of winding up stepping through code
you actually need to see, rather than marching endlessly through
java.util.Logger's source code and other irrelevant stuff, are
infinitesimal.  Debuggers are a great tool for debugging algorithms you can
isolate in a test or tiny application, or for learning how programs work
when you're learning to program.  As a tool for fixing things in huge
applications with deep stacks, they're pretty much useless - way too much
distracting noise and way to little signal.

My suggestion is, learn to love logging statements and
System.out.println().  You can isolate problems quite fast if you do a sort
of logging-binary-search - add a logging statement entering the code where
something goes wrong, and one at a point where that thing probably has
already gone wrong.  If that works as expected, add logging at the midpoint
between those two points.  Still okay at the midpoint?  Add one between the
middle and end - and so forth until you're on the line where things really
do go wrong (usually just narrowing down the scope lets you see it).

Sorry to be a downer on debuggers, but I can count on one hand the number
of times I have learned anything useful from a debugger, and all of those
times I could have probably found it faster if I'd just read the code.

-Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to