[PJUG Javamail] debugging server-side code

Bill Jackson bill.jackson at oracle.com
Sat Aug 11 19:57:01 UTC 2007


+1 to Matt.

Steven, I can't help being curious about the details of your bad 
experience; I have never had such problems (though I have only been 
using a live debugger for the last four years).  I just start my server 
or app with the JDWP RI agent enabled, and off I go.  I even build it 
into all my Ant scripts, using optional properties with reasonable 
defaults (i.e. suspend=n, no address).

It seems to me that the debugger is just another tool in the developer's 
toolbox, and an absolute refusal to it can be just as harmful as 
over-reliance on it.

-Bill


Matt Reynolds wrote:
>> http://c2.com/cgi/wiki?ForgetTheDebugger
>>
>> I'm not kidding, either. I haven't used a debugger in years, except
>> once or twice as a final last-ditch tool after trying everything else.
>>  Once, several years ago, I jumped through all the hoops required to
>> try to get my IDE to remote debug an app server using JPDA. That
>> horror pretty much ended my debugger dependence.
>>     
>
> I've found getting Eclipse and newer JVMs into "debug mode" to be a  
> breeze.  Setup the remote VM to wait until a debugger attaches, and  
> away you go.
>
> I'm normally all about not using the debugger, but the place I've  
> found it's needed most is with legacy code (which you almost always  
> inherit at every job) that has poor unit testing.  Worse if it's  
> tightly coupled and resistant to unit testing.
>
> I've also found that IoC complicates the matter if it's not organized  
> in a clear manner.  I have an interface, but I don't necessarily know  
> which class is implementing it without adding alot of debug statements.
>
> If you're writing something from scratch, have a well designed app,  
> and have unit tests, don't use the debugger.  Unfortunately, that's  
> not been the norm at the places I've worked.
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://javac.com/pipermail/javamail/attachments/20070811/a3f7f3cd/attachment-0002.html>


More information about the Javamail mailing list