[Nottingham] A Little Coding Gem

Martin martin at ml1.co.uk
Thu Nov 15 19:09:25 UTC 2012

OK... I'll bite:

On 15/11/12 18:43, Jason Irwin wrote:
> On 15/11/12 18:08, Martin wrote:
>> Anyone like to guess or even work out what it does? :-> (Evil grin :-) )
> What it does it drive you (or the maintainer) totally bats in three
> years as there is no comment because it was so obvious at the time.

Ahhh... But programmers don't get paid for writing comments and such
fluff... Try explaining to the accountants/managers that there is more
to it than just the code...

Now... If we could perhaps enjoy a more monastic type of approach to
craft good code without the time/cost inflicted compromises...

> public class myClass
> {
> 	private Boolean myCheck;
> 	public static main(String... args)
> 	{
> 		if (myCheck)
> 		{
> 			System.out.println("Hello world");
> 		}
> 	}
> }
> What's that do then?
> If TJ or Roadie take more than a nano-second to work it out, I'll be
> disappointed.

OK, that looks like C++ that is inside-out so it must be Java.

Two screamers are the uninitialised boolean and a missing "void" for main...

It /should/ be that it generates an error?


I don't like the "..." notation. After so many decades, why not simply
keep to using the more succinct and structurally descriptive "[]"?

And I've never looked at Java but putting main inside a class looks and
feels weird.

> I've got a bunch more somewhere...they're really boring I assure you.

They should be very interesting if they *do something useful* in an
/efficient/ or /neat/ way. A little obscurity helps also... ;-)

Respective unresolved answers to be disclosed as appropriate Friday
evening, possibly over/post beers :-)


- ------------------ - ----------------------------------------
-    Martin Lomas    - OpenPGP (GPG/PGP) Public Key: 0xCEE1D3B7
- martin @ ml1 co uk - Import from   hkp://subkeys.pgp.net   or
- ------------------ - http:// ml1 .co .uk/martin_ml1_co_uk.gpg

More information about the Nottingham mailing list