Slashdot Mirror


Latest Proposals for C++0x

CodeDemon writes "It looks like the ISO/IEC JTC1/SC22/WG21 working group has made some headway in reviewing new proposals for the C++ language. The long anticipated upgrade for C++, C++0x, may be just around the corner. Head on over to check out the proposals yourself."

2 of 911 comments (clear)

  1. Re:"two week"??!! by IceAgeComing · · Score: 0, Offtopic

    And now someone, who has mastered sticking his foot in his mouth, can go crawl back into his highly American-centered hole. Bjarne Stroustrup's native language is not English.

  2. Java and C++ by master_p · · Score: 0, Offtopic

    Java is a joke for static applications for the following reasons:

    1) Lack of templates. This makes the code an unreadable mess of casting. Not to mention that every cast in Java is a dynamic cast.

    2) Lack of stack-allocated objects. Everything, even the smallest integer, must be allocated on the heap. Which means memory is too easily fragmented.

    3) The garbage collection moves memory around. That means that a Java pointer is a triple pointer: a variable which points to a variable which points to the object. Then, the garbage collector knows the middle pointer and can change its contents as needed by moving the object around. Twice as slow as C++.

    4) Garbage collection does not help the memory management problem. If I forget to nullify a pointer, the object remains in memory forever.

    5) A static app does not need a VM. It slows things down. Why should my code be translated on the fly, since a compiler would know beforehand what my program does ?

    Java has the following advantages:

    1) it runs everywhere.

    2) it provides a rich set of classes for every need. Especially gui.

    Now that I bashed Java and got it off my chest (I make applications with Java/C++ for a living), let's get off to C++. I love C++, especially for the template metaprogramming that it has, but it has some serious problems:

    1) the operator = is transferrable to a class/struct's members. Why not about the other operators ? For example the + operator. That way I could add two structs by using the operator + without having a temporary object to store the result.

    2) The lack of defining own operators

    3) Having to declare everything explicitely. For example x = 3 should be enough

    4) Having to declare two versions of each method, one when the object is const and one when the object is not const

    5) Having to put a semicolon after a class or struct declarations (as if the curly brackets were not enough)

    6) Having to declare forward stuff

    7) Having separation of header files and implementation files. This is the biggest language problem. It makes development problematic, since every change of the API requires two modifications.

    8) Lack of a standard String class

    9) I can't overload the operator '.'

    10) It does not have properties. A simple alias to get_x/set_x would be the x =, int i = x. It's only syntactic sugar, but it matters.

    11) lack of delegates, signals and slots

    12) lack of reflection

    13) unsafe variable argument list mechanism

    14) lack of threads

    There are many more things that are problematic, but I don't remember all right now (in one point in time I had constructed a list with 68 things that irritate me about C++). Although the language has the problems mentioned above, they can be overcomed by various techniques, and they are not as serious as the Java ones.

    The biggest problem is that it lacks standard libraries. A good language would come with standard gui, database, io, xml, collections, threads, internationalisation, etc. From all this, C++ has only collections. Mr Stroustrup correctly identifies the lack of threads, but what about the gui ?