J
Joona I Palaste
Found in my work colleague's code...
List historyList = /* ... */;
double divider = Double.parseDouble("" + historyList.size());
Now I have come to expect that my colleagues are still stupid enough to
use the ""+ trick to convert primitives to Strings, but that someone who
gets paid to write Java code doesn't know that ints widen to doubles
when assigned to double variables, and instead goes to the trouble of
*creating a String object* instead, is amazing!
List historyList = /* ... */;
double divider = Double.parseDouble("" + historyList.size());
Now I have come to expect that my colleagues are still stupid enough to
use the ""+ trick to convert primitives to Strings, but that someone who
gets paid to write Java code doesn't know that ints widen to doubles
when assigned to double variables, and instead goes to the trouble of
*creating a String object* instead, is amazing!