From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 146b77,d275ffeffdf83655 X-Google-Attributes: gid146b77,public X-Google-Thread: 101b33,d275ffeffdf83655 X-Google-Attributes: gid101b33,public X-Google-Thread: f849b,d275ffeffdf83655 X-Google-Attributes: gidf849b,public X-Google-Thread: f5d71,d275ffeffdf83655 X-Google-Attributes: gidf5d71,public X-Google-Thread: 103376,d275ffeffdf83655 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,d275ffeffdf83655 X-Google-Attributes: gid1108a1,public X-Google-Thread: 109fba,d275ffeffdf83655 X-Google-Attributes: gid109fba,public X-Google-Thread: 115aec,d275ffeffdf83655 X-Google-Attributes: gid115aec,public From: Scott Johnson Subject: Re: Ada vs C++ vs Java Date: 1999/01/19 Message-ID: <36A45876.6558@nospam.aracnet.com>#1/1 X-Deja-AN: 434355960 Content-Transfer-Encoding: 7bit References: <369C1F31.AE5AF7EF@concentric.net> <369DE6A6.8CD88A4B@acm.org> <369F0118.7870@nospam.aracnet.com> <36A3600A.3106C63B@dresdner-bank.com> Content-Type: text/plain; charset=us-ascii Organization: National Association for the Advancement of Computer Geeks Mime-Version: 1.0 Reply-To: sj_nospam@nospam.aracnet.com Newsgroups: comp.lang.ada,comp.lang.c++,comp.vxworks,comp.lang.java,comp.java.advocacy,comp.realtime,comp.arch.embedded,comp.object,comp.lang.java.programmer Date: 1999-01-19T00:00:00+00:00 List-Id: James Kanze wrote: > > Scott Johnson wrote: > |> Since your laundry list :) missed > |> the programming paradigm most fashionable these days--component > |> programming--Java provides better native support for this than does > |> C++. > > What native support? The main component-based programming idiom in > Java is beans, which is mainly a set of programming conventions, which > could in principle be used in C++ or any other language. Inner classes for one. While they can be replicated in C++ (see a thread in comp.std.c++ for more on this one), they require a bit more work. Standard techniques for things like object serialization and introspection for another. This can also be done in C++ of course, and can be done automagically if you use various distributed object and/or component technologies. (Of course, then you are writing lots of code in some IDL which gets compiled into C++; with Beans, you write your code in Java.) Both of the above have C++ solutions. What does not have a good C++ solution, is a key part of Java, and is very important if component based programming is to be a reality--a standard binary interface. You can't even (usually) link two C++ libraries together if they weren't compiled by the same compiler--this is IMHO a **MAJOR** weakness for C++--at least in this application. About the only vendor I can think of that does this well--and I hate to admit it--is Microsoft. When you not only own a monopoly share of the OS market for a particular architecture, but own the vast majority of the development tool market, you can get away with this. :) Actually, I'm surprised that other key silicon/OS vendors haven't tried to get together and specify C++ ABIs for various architectures--I'm not aware of any formal standardization along these lines. After all, my current project at work uses a MPC860 processor, and there is a nice, universally accepted standard as to how registers are allocated in functional programs; how stack frames are construted, how structs are laid out, the size and alignmnent of the fundamental types, etc--allowing me to link C code compiled with gcc to C code compiled with CodeWarrior or Diab Data or Green Hills. Unfortunately, there ain't no standard I'm aware of that says how the this pointer gets passed, or how exception-capable stack frames are set up, or how classes are laid out, or how virtual functions and virtual base classes are handled, or how function names are mangled, etc. Now that the work on standardization of the language and libraries are finished--this would be major benefit. Scott