3 ms·
That part is fine, but Java idioms seem to routinely think that String string = new String("string"); isn't enough repetition, and so they take it a step
by dheera 6y ago
That part is fine, but Java idioms seem to routinely think that
String string = new String("string");
isn't enough repetition, and so they take it a step further:
StringFactory mStringFactory = new StringFactory(StringFactory.FOO || StringFactory.BAR);
StringOptions stringOptions = new StringOptions();
try {
String string = mStringFactory.createString(StringFactory.STRING, "string", stringOptions);
} catch (java.lang.string.StringException e) {
runOnUIThread(
new Runnable() {
try {
// facepalm
I'm exaggerating ;) but as a Python programmer myself, this is what comes to my mind whenever someone says the word "Java" to me. Obviously not for strings, but for more advanced constructs (e.g. Bluetooth) I often do see this much repetition in Java code. It's almost like someone designed this language to prank engineers.
- arethuza 6y agoThat a reasonably parody of a lot of Java code - but I don't think it's really a property of Java the language but some odd principles that seem to be popular (or used to be popular) in the Java community. BTW You missed: public static final String STRING_STRING_CONSTANT = "string";