I dunno. But then, if you don't need to do pointer arithmetic in the work that you do, why, then, would you try to do any? There is nothing in the language that compels you to do pointer arithmetic at random intervals in your code....To bring up a point raised before, namely the use of autopointers... have they fixed the problem with using autopointers and the STL yet? I don't think so, and in fact I had to fix an issue related to that the other day.
How do you interate through a list of sequentially organized objects?Use a List and an Iterator object. Java Iterators, unlike C++ iterators (and Java Enumerations, incidentally), are safe from side-effects as well.
Is there an STL-like collection for references to objects of like type, in which an interator object is defined?Yes. Actually the Java collections can hold objects of any type. How do you iterate through a list of arbitrary, unrelated objects in C++? And how do you deal with the problems of equality vs. equivalence, which are handled explicitly in the Java collections?
What about the indeterminately sized array of char, that C people refer to as a string? How is that interated?What about it? There's the String class (for constant strings) and the StringBuffer if you want to change it after you've created it. As for "lightweight", it's pretty much the same thing, internally: an array of bytes. What you're thinking of from the "proponents" is probably the fact that when you create a new String from an old one, through 'substring()' or the like, the new String instance shares the old byte array and simply uses a different begin and end index.
Without trying to be pedantic, I assume you mean problems created by the language.Point noted, and it is an important one. (what do you mean, 'without trying to be pedantic'... in THIS crowd?? ;-) Speaking of pedantic, it's "iterator", not "interator"... ;-)
Perhaps I am more comfortable with the wild-and-wooly nature of C++ than you are; you might prefer the more politically-correct, Father-knows-best approach that Java provides. That's OK with me.Please. [link|http://web.archive.org/web/20011116015209/http://w3.one.net/~jweirich/oostuff/awk.html|Give] [link|http://web.archive.org/web/20011116015209/http://w3.one.net/~jweirich/oostuff/psout.txt|me] [link|http://web.archive.org/web/20011116015209/http://w3.one.net/~jweirich/oostuff/dosbatch.html|a] [link|http://web.archive.org/web/20011116015209/http://w3.one.net/~jweirich/oostuff/sed.html|break]. I'm probably going to Hell for using some of the languages for OO programming that I have. Java is no more or less "wild and wooly" than C++... in some cases it is more so than C++ (think runtime loading of classes that just arrived over the wire as binary data).
I personally don't see that Java is not without its own "problems with the language".I explicitly said that it wasn't in my original post. I said that it sucks less than C++. ;-) In fact I'll list a few for you: proliferating libraries du jour, base types aren't fully objects, and a tendency to sell Java as the cure-all for everything from code bloat to Grandma's bunions.
One that comes to mind is the handling of exceptions; it is pedantic to require the caller of a function that can raise an exception to handle all exceptions that that called function can produce.And in my opinion it's bad practice not to explicitly catch them all.
I'm also not real pleased with the stick-both-definition-and-declaration-of-everything-in-one-file nonsense; makes for real unreadable codeYour opinion; that style was created explicitly to get rid of the stupid .h file proliferation you see in C++. I think it's asinine to have to have tons of crap all declared in the same .h file AND in the .cpp files. The Java hierarchical package system is one of the better points for the language, IMO. It helps with organizing and packaging things.
And then, there's Swing, and the other User Interfaces du jour that make trying to get anthing out of Java such a joy.Are we talking about libraries, or the language itself now...?
I'm sure I can come up with several dozen other "problems with the language" once I becmore more familiar with it.And I'm sure I can with C++ as well. ;-)
In fact, I'll probably be able to match you problem for problem.Or handwave them away with "that isn't a problem for me"...? ;-)
Perhaps you're dangerous with C++ for the same reasons?Who said I was dangerous? I've been talking about other people's code and what a pain-in-the-ass it is to work with... And this stuff was written by intelligent people (one of whom did his own port of STL to gcc 2.95.2). It's like perl: great if you're working on it by yourself, but horrible once you start to bring other people into the same code base; this sort of overly, needlessly complex crud kills large development efforts. Java protects me from other people's stupidity.
And how about that wacky template debugging fun? Whew, and we thought C-compiler error messages were incomprehensible... ;-) That's not to say that templates don't have their advantages. However, IMO the disadvantages far outweigh them.
C++ was developed as a hacked on preprocessor to C. The world has moved on to develop better object oriented C implementations since then. Unfortunately the world also runs on the "good is enough, better is worse" principle as well.