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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10261c,90121986704b5776 X-Google-Attributes: gid10261c,public X-Google-Thread: 103376,4873305131bf4d94 X-Google-Attributes: gid103376,public X-Google-Thread: fdb77,4873305131bf4d94 X-Google-Attributes: gidfdb77,public X-Google-Thread: 109fba,4873305131bf4d94 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,4873305131bf4d94 X-Google-Attributes: gid1014db,public X-Google-Thread: 10c950,90121986704b5776 X-Google-Attributes: gid10c950,public From: Bob Horvath Subject: Re: Yet another stupid language war (was: ... the only languages you need!!) Date: 1997/10/31 Message-ID: <345AAAF5.199FEDD3@horvath.com>#1/1 X-Deja-AN: 286329620 References: <34557f2b.1934172@news.mindspring.com> <3458D116.2D34@pseserv3.fw.hac.com> <63anc7$75p$1@darla.visi.com> <345947D2.D20EF8E9@horvath.com> <63d34m$ap7$1@darla.visi.com> Organization: EnterAct L.L.C. Turbo-Elite News Server Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.lang.java.advocacy,comp.lang.pascal.ansi-iso,comp.lang.pascal.misc Date: 1997-10-31T00:00:00+00:00 List-Id: Peter Seebach wrote: > In article <345947D2.D20EF8E9@horvath.com>, > Bob Horvath wrote: > >I have heard of an Ada to Java bytecode compiler, so now I guess you can have > >Ada everywhere! > > Java only runs on a smallish number of popular desktop platforms. > > >> Java is intended to produce executables and programs which are portable > >> across all implementations; this does not necessarily make it a widely > >> portable language. > > >I don't understand this statement. > > There are not implementations for some platforms, so, even if a program > runs on all java implementations, it may not run on all that many different > platforms. Got it now. Thanks. > > > >> Speak for C++. :) C has a bit of history, but is really fairly > >> consistent. :) > > >Hmmmm. How big is an int? > > Do you want storage space or range? Storage space is 'sizeof(int)', > range is [INT_MIN, INT_MAX]. Range. I want something that maps directly onto the problem domain. Isn't that what all of this OOD paradigm is all about? If I need somethat goes from > C is portable in a way unlike the way Java is. Code that doesn't need > to know what size an int is can be portable among all implementations. I would agree with you that Java has solved a portability problem by specifying the size of integer types, but I think the Ada method of having types based on ranges is a better way of doing things. I would disagree that code that doesn't need to know the size of an int can be portable among all implementations. The size of an int defines the range of values that will behave predictably. Change to an implementation that changes the size of an int, and the type definition has just changed. > Code which needs a specific size of object is frequently intrinsically > not portable by nature. C wouldn't want to offer you a guaranteed, 32 > bit type, because that might be horrendously inefficient on a 36-bit machine. > :) I can't think of many problem domains that require an integer to be a certain size. Most problem domains require that a numeric value be capable of representing a certain range of values. A guaranteed 32 bit integer in C would be welcome (which is why they have defined integer sizes in Java). If you assume an int is 32 bits, then it will break on a machine that defines it as 16 bits, and if signed, might sign extend differently on a 64 bit machine.