On preprocessors & Java

The following is a link to an open source pre-processor program for Java:

http://jappo.opensourcefinland.org/

I think it is shockingly short-sighted on the part of Sun developers that they are so obstinately refusing to include a pre-processor with the Java compiler. While MACROs are admittedly the source of many bugs in the C and C++ world, a more reasonable approach should have been taken instead of completely cutting it out as the benefits derived out of using them is real and indispensable. C# and .NET for instance include a pre-processor that has relatively fewer capabilities as compared to the C/C++ pre-processor but still allow for the writing of conditionally compiled code. Microsoft has got it perfectly right on this count IMO.

If you're wondering where all this angst is coming from, we recently discovered that the changes that we had made to a certain applet for incorporating a set of changes was not implemented in the source branch for Microsoft's VM (yep, we have customers who still use that VM!). If we'd had conditional compilation then it would have been a simple matter of #ifdef ing out the relevant portions instead of having an entire branch!

The fact that an open source effort for developing a pre-processor for Java exists at all is evidence enough IMO of the need for it. Grrrr.

comments powered by Disqus