Subscribe: Comments on Technical Revenue: Using Tricky Assertions
http://paultyma.blogspot.com/feeds/4199663102624706357/comments/default
Preview: Comments on Technical Revenue: Using Tricky Assertions

Comments on Paul Tyma: Using Tricky Assertions





Updated: 2017-10-26T14:35:29.847-07:00

 



assert essentially gets compiledto something likep...

2008-06-06T10:00:00.000-07:00

assert essentially gets compiled
to something like

private static final boolean
assertionsEnabled =
Boolean.getBoolean("some.system.property");

....

if (assertionsEnabled) { ... }

I think it would be clearer
to copy the implementation rather
than piggybacking on assert.
Get debugging output when invoking
your application with something
like
java -Dmyapp.debugLogging=true ...

Trust the JIT to do a reasonable
job optimizing away code guarded
by a static final boolean.



Neat idea, thanks for sharing. I was using sed sc...

2007-08-27T12:55:00.000-07:00

Neat idea, thanks for sharing. I was using sed scripts in my compiler script to replace all debug-related System.out.println statements up to today.