IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 1 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Re: I guess I don't see the problems with the compiler
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 code
Your 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.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New OK, here's where we agree to disagree, and agree to agree...
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"... ;-)

Yeah, I know. Just tell my hands...and wait till I get used to this goofy Compaq keypad...;-)

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.

What, to simply pass them on to the next higher level, because you know there is a higher level function that is designed to handle those specific exceptions? The trouble with panaceas, IMnsHO is that they dont take into the account the details of the situation...you know, like when all you have is a hammer, everything looks like a nail? (Or my new favorite," When all you have is FrontPage, everything looks like a web server".)

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. ;-)

Which would become a waste of both our times. What say we simply agree that both languages have their strengths and weaknesses, and neither are optimally suited for everything?
Or handwave them away with "that isn't a problem for me"...? ;-)

What?!? When did I become Marlowe? ;-)
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.

I agree that working with other people's code is a pain. I said that earlier. I don't agree that Java, or any other language protects one from other people's stupidity. I feel that way about Java especially, because every example of Java code I've seen has been an incomprehensible jumble, including the stuff that is supposed to be "really good stuff". It is my opinion that Java itself lends itself to this, because of its pile-everything-into-the-same-file approach to writing. But nobody, and I mean nobody (present company excluded) gives two shits about the readibility of the code they write. so I think here we can agree, and disagree simultaneously.
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.

This I 100% agree with. And I'd like to see Objective C sometime, to see what all the hoopla is all about. But I doubt you'd disagree that someone who can make a complete mess of a C++ source file can (and generally will) make an equal mess of an Objective C source file, or a Java source file as well, for that matter.
jb4
"They lead. They don't manage. The carrot always wins over the stick. Ask your horse. You can lead your horse to water, but you can't manage him to drink."
Richard Kerr, United Technologies Corporation, 1990
New Re: OK, here's where we agree to disagree, and agree to agre
What, to simply pass them on to the next higher level, because you know there is a higher level function that is designed to handle those specific exceptions?
To explicitly note that you are passing that exception up. In case in the future your method gets called by a different method than the one you were assuming would catch it. Implicit code will always bite you given enough time.

Which would become a waste of both our times. What say we simply agree that both languages have their strengths and weaknesses, and neither are optimally suited for everything?
Except that I've never seen such a comparison ever come to anything other than "Java fixes this stuff in C++. Answer: yeah, but Java is slow," a response which says nothing about the problems pointed out in C++. As Ashton likes to say, "Now we know what your opinions of Java are. Can we talk about C++?".

I said that earlier. I don't agree that Java, or any other language protects one from other people's stupidity. I feel that way about Java especially, because every example of Java code I've seen has been an incomprehensible jumble, including the stuff that is supposed to be "really good stuff".
Would it be poor manners to point out that this is the exact converse of your "you haven't done enough C++ yet" argument...? ;-)

It is my opinion that Java itself lends itself to this, because of its pile-everything-into-the-same-file approach to writing.
Wrong. One class (and associated inner classes) per module. No headers needed. Why? Because the interface information is inscribed in the compiled object. Separating interface out in headers only creates a maintenance hassle, because you have to change TWO files when the interface changes. Not to mention all the necessary #include dependencies. If you want a readable interface document, read the Javadocs. That's what they are there for. Using .h files as interface documentation is a bad idea too.

But I doubt you'd disagree that someone who can make a complete mess of a C++ source file can (and generally will) make an equal mess of an Objective C source file, or a Java source file as well, for that matter.
An equal mess? Not at all. Poor Java code still compiles cross platform and cross compiler. And I will continue to disagree with your assertion that Java doesn't help to protect me against other people's stupidity. Case in point: the virtual keyword in conjunction with using 3rd party libraries.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
     Re: There is NOTHING wrong with pointers! - (admin) - (46)
         Re: There is NOTHING wrong with pointers! - (dshellman) - (5)
             Cross-platform can be nasty. - (admin)
             Er,...really? - (jb4) - (3)
                 Java pointer problems - (ChrisR) - (2)
                     OT: threading - (admin)
                     Just a nit - (dshellman)
         Re: There is NOTHING wrong with pointers! - (deSitter) - (1)
             Re: There is NOTHING wrong with pointers! - (admin)
         I guess I don't see the problems with the compiler - (jb4) - (33)
             Hmmmm - seems this thread got derailed due to ... - (dmarker) - (27)
                 Java isn't a systems language at all, IMO. - (admin) - (26)
                     I sure wouldn't use Java for Systems work - (dmarker) - (25)
                         Which brings up the point: what IS systems work - (admin) - (24)
                             The other aspect is... - (ChrisR) - (18)
                                 Stroustrup has a great quote about that: - (admin)
                                 Which is why C/C++ can be easily integrated with anything - (Arkadiy) - (16)
                                     *C* is the lingua franca. - (admin) - (15)
                                         ObjectiveC++ - (tuberculosis)
                                         Welcom to my nightmare! - (jb4) - (13)
                                             ABI: Application Binary Interface - (admin) - (12)
                                                 I used to think Direct To SOM compilers would fix this - (tuberculosis) - (1)
                                                     Some progress has been made. - (admin)
                                                 Snide remark and a question - (jb4) - (5)
                                                     Snide response. - (admin)
                                                     Libraries - remember those? - (tuberculosis) - (2)
                                                         Exactly. - (admin)
                                                         Reality check: why libraries matter: - (admin)
                                                     Libraries - remember those? - (tuberculosis)
                                                 a day late and a dollar short...but extern "C" - (Simon_Jester) - (3)
                                                     For a 3rd party module? No. - (admin) - (2)
                                                         If you export C++ mangled functions, you're screwed. - (Arkadiy) - (1)
                                                             Or, rather: Export C++ mangled functions in a lib you sell.. - (CRConrad)
                             Simple - (deSitter)
                             No - (Arkadiy) - (2)
                                 But, in the hands of a good programmer, it's a sharp tool. - (admin) - (1)
                                     Like Cathie Ryan said... - (Arkadiy)
                             Friend of a Friend - (tuberculosis)
             Re: I guess I don't see the problems with the compiler - (admin) - (2)
                 OK, here's where we agree to disagree, and agree to agree... - (jb4) - (1)
                     Re: OK, here's where we agree to disagree, and agree to agre - (admin)
             Geronimo! - (tuberculosis)
             Attacking Java doesn't make C++ better - (tuberculosis)
         does the content of this thread indicate Bryce is right? :-) -NT - (boxley) - (3)
             Inasmuch as: - (admin)
             C++ implements OO programming - (tuberculosis)
             Not at all. - (static)

LOOP WAS VECTORIZED.
117 ms