From 1579004526131882109
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc772,cda54862ecb4a41f
X-Google-Attributes: gidfc772,public
X-Google-Thread: f78e5,cda54862ecb4a41f
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-08-30 10:52:07 PST
Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!chcgil2-snh1.gtei.net!denver-snf1.gtei.net!news.gtei.net!namche.sun.com!news2me.EBay.Sun.COM!engnews1.eng.sun.com!taumet!clamage
From: "Gaurav Sareen" <albelakela@hotmail.com>
Newsgroups: comp.std.c++,comp.lang.c++.moderated
Subject: Re: storage order of inherited classes
Date: 30 Aug 2001 17:43:15 GMT
Organization: Road Runner - Texas
Lines: 30
Approved: stephen.clamage@sun.com (comp.std.c++)
Message-ID: <mQ7j7.511357$lq1.104203497@typhoon.austin.rr.com>
References: <MpMh7.6544$3f.1248650@news2-win.server.ntlworld.com>
 <XPai7.507226$lq1.100246902@typhoon.austin.rr.com>
 <d6651fb6.0108280024.3d12f6d6@posting.google.com>
NNTP-Posting-Host: taumet.eng.sun.com
X-NNTP-Posting-Host: netlab.cs.rpi.edu
X-Original-Date: Wed, 29 Aug 2001 15:26:10 GMT
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
	iQBVAwUAO44r2UHMCo9UcraBAQFTbgH/acsSmB5UOqZGhUPvEIJxC7pqGwEoBZAR
	iNPLIgrcqOXprbNaecYphZa+ZOgQIsKf35DlgVaGZP+jsh39143VJw==
	=G9eh
X-Approved-For-Group: francis.moderator@robinton.demon.co.uk comp.lang.c++.moderated
Content-Length: 1295
X-Status: $$$$
X-UID: 0000000001
Originator: clamage@taumet
Xref: archiver1.google.com comp.std.c++:7248 comp.lang.c++.moderated:25786


> > This IMO is one of the big reasons why java can be "safer" than C++
> > is that the runtime layout of the classes is fixed.
>
> Just curious.  I can see how this makes Java more portable than C++,
> at least for some definitions of portable, but how does is make the
> language "safer"?

In the sense that you cant look at a compiled class and make sure its well
formed.

I was talking in terms of the VM being able to do verification of the byte
code, which basically means that it can make sure that the code is not ill
formed, and wont cause some of the unsafe memory corruption that can happen
by executing native code. I agree some of the java safety comes at the cost
of (slow) runtime checks, and even the above checking while loading may be
slow but it sure is safer.



      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]

[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]




