foobar:

I'm sorry to say but that *is* a _horrible_ _hack_. It looks almost as awful as it does in python with the underscores.

Java has the correct DRY solution - each class can define a static main method but the compiler only uses the one specified by a compiler switch. The above basically asks the programmer to endlessly repeat the same trivial implementation boilerplate that should be written just once _in_ the compiler.

What I have suggested is the simplest (requires less stuff to be implemented) way to solve the problem, adding just a single compile time constant. But I agree there are better ways to solve the same problem. I am asking for a specific way to solve this problem, but since some years I'd like some "good enough" way to solve it.

Bye,
bearophile

Reply via email to