Coming from C++ to Java, the obvious unanswered question is why didn\'t Java include operator overloading?
Isn\'t Complex a, b, c; a = b + c;
much simpl
Check out Boost.Units: link text
It provides zero-overhead Dimensional analysis through operator overloading. How much clearer can this get?
quantity F = 2.0*newton;
quantity dx = 2.0*meter;
quantity E = F * dx;
std::cout << "Energy = " << E << endl;
would actually output "Energy = 4 J" which is correct.