10 Reasons We Need Java 3.0
Subject:   Include some of the good parts of C++
Date:   2002-08-06 06:44:11
From:   grs19689
I am a C++ programmer as well as a Java programmer. I'm always wishing I had some of the features of C++ available when I write Java.

1) The "const" modifier. I have never been able to work out my Java does not have this.

2) The advanced features of the STL - iterators and algorithms particularly. I know there are implementations of the STL in java but I'd like to see the features of the STL made standard in the java.util package.

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Given your subject, I was afraid to read your message...
    2002-08-06 07:19:01  ewatkeys [View]

    But I think const-ness is a very good idea. C++, it can be a real pain to properly implement proper const-ness on an object. Determining what methods change state and what ones don't can take a lot of time. That's my only problem with seeing this feature in Java.

    Just like access control, const-ness is one of those nice-to-have features that raises the hurdles to getting a class ready for prime time. A "proper" C++ class is a pain to build. Overloading assignment operators, default constructors, copy constructors, destructors. It makes you not want to create a new class.

    A nice part of Java is that you don't need to be a language lawyer to write code that works as a class is expected to.
    • Everything is const
      2002-08-28 14:17:18  bjsyd70 [View]

      Well not quite everything, but most things.

      Const is not worthwhile - the vast majority of variable I use are const.

      Fully identifying this would be painful.

      I just worked on some C++ code which would not compile after a compiler/STL version change because of a great many things, including changing interpretations of const.