J
Jussi Piitulainen
Tom Fredriksen writes, referring to new String("java"):
Why bother? One should write just the simpler "java": The writer of
the code has less to do. The reader of the code has less to do. The
compiler writer has less to do. The program itself has less to do.
Just about everybody is happier.
Let the compiler writer spend their time on things that are generally
useful in the programs that people actually write.
And stop writing new String("java"), please. Where do people pick this
up anyway? Do they just like the tedium? Could they be convinced to
write "java".intern().intern().intern() instead? (It's even longer.)
What we want is an string object with the given value, the second
seems to do more work than necessary, for the string case, so why
not optimise it away?
Why bother? One should write just the simpler "java": The writer of
the code has less to do. The reader of the code has less to do. The
compiler writer has less to do. The program itself has less to do.
Just about everybody is happier.
Let the compiler writer spend their time on things that are generally
useful in the programs that people actually write.
And stop writing new String("java"), please. Where do people pick this
up anyway? Do they just like the tedium? Could they be convinced to
write "java".intern().intern().intern() instead? (It's even longer.)