[josm-dev] r4188 - removal of debug code
Dirk Stöcker
openstreetmap at dstoecker.de
Sun Aug 21 13:21:05 BST 2011
On Sun, 21 Aug 2011, Stefan Breunig wrote:
>> I'd have a really hard time believing that the JVM can't optimize stuff
>> like this:
>
> and right you are;
> http://stackoverflow.com/questions/1813853/ifdef-ifndef-in-java/1813871#1813871
>
> It's compiled out, even if the main function isn't static. If you are
> in doubt, just javap -c at the class file and search for a debug string
> with debug = false and with debug = true and see if it works for the
> class at hand.
Hmm, I don't really trust this. It possibly works for easy situations, but
I have seen to much "this should be optimized out" code remain in release
versions to really rely on that feature.
I know sometimes I'm old-fashioned (not wanting git, don't using all
these fancy new tools for specific tasks, not relying on compiler
automatics, ...), but most of this comes from experience: E.g. if you do
re-engineering of Assembler code to find a bug in your software and find,
that the compiler is broken you loose your trust in compilers.
I hope you all can live with that. :-)
P.S. I'm even one of the few people not using IDE's at all, as I learned
programming before graphical-all-in-one-interfaces became available. Which
on the other hand means I still can work from 80x25 ASCII remote terminals
without any problems.
Ciao
--
http://www.dstoecker.eu/ (PGP key available)
More information about the josm-dev
mailing list