by 430gj9j · 14y ago · 0 comments
String x = "foo";
String y = "foo";
// Appears to work but compares references
System.out.println(x[0] == x[1]);
There's no substitute for knowing your tools well.I don't love Java, not by any stretch, but it's difficult to argue that Java and C++ are anywhere near equivalent in this dimension. Effective C++ is littered with examples of gotchas which are highly peculiar to C++ and the C++ compiler. It's an incredibly complex language.
Whether C++ worth these trade-offs for a particular team, project, or company is orthogonal.