Category Archives: Java

Java Abuse – Currency Pattern

Here’s a sillier one from last night…
People often complain about not being able to return multiple values from a method in Java. I can’t see a good reason for wanting to do this, but some do.
The example I was given was wanting to do:

int foo, bar, baz; list(foo, bar, bar) = func(ponies);

Where func(ponies) returns 3 [...]

Posted in Java | Tagged | 1 Comment

Java Abuse – Ternary Try/Catch

We often discuss Java limitations on IRC and try to come up with (sometimes silly) workarounds. Unfortunately after time passes it’s often easy to forget the outcome, and lose code snippets. So I thought I’d start blogging some of them so I don’t lose them, and other people might suggest other ways of doing things [...]

Also posted in Uncategorized | Tagged | 5 Comments