News for hackers. Stuff that matters.
Re:C++ pitfalls by 430gj9j on Wednesday November 28, 2012 @11:48AM (#4843448)
All languages have pitfalls. Including the author's beloved Java. For example:

   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.
Re:C++ pitfalls by wonderzombie on Wednesday November 28, 2012 @03:52PM (#4844663)
The difference is that languages can have more pitfalls, more severe pitfalls, pitfalls which are more difficult to detect, and so on.

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.

Re:C++ pitfalls by diek on Wednesday November 28, 2012 @02:30PM (#4844204)
I assume you meant to say:

    System.out.println(x == y);
Re:C++ pitfalls by 430gj9j on Friday November 30, 2012 @07:00AM (#4852859)
Yes. In a previous version I was trying to bypass string caching to make x==y return false.