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: 10a146,fee8802cc3d8334d X-Google-Attributes: gid10a146,public X-Google-Thread: 103376,fee8802cc3d8334d X-Google-Attributes: gid103376,public From: rich@nowhere.com Subject: Re: Ada and Java. different behaviour. casting long to int problem. Date: 1999/06/15 Message-ID: <7k689a$ci2@drn.newsguy.com>#1/1 X-Deja-AN: 489975651 References: <7jt2c0$vrb@drn.newsguy.com> <7k57vb$1ipf@drn.newsguy.com> <3766650F.705125B7@pwfl.com> <7k64t7$igo$1@its.hooked.net> Newsgroups: comp.lang.ada,comp.lang.java.programmer Date: 1999-06-15T00:00:00+00:00 List-Id: In article <7k64t7$igo$1@its.hooked.net>, "Mike says... > >I agree completely. To my mind, quietly producing a non-intuitive result >(via truncation or wraparound) is in the same league as being able to >quietly step off the end of an array (something the Java folks beat up on >the C/C++ folks about constantly). > I agree also. But to play devil advocate, and using similar argument allready given to us in this thread, one can reply: as long as the language is defined to behave this way, it becomes the programmer resposibility, and any unexpected behaviour resulting from using such language means the programmer is incompetent. So, as long as C/C++ is defined not to do array boundary checking (which it is), then no one has the right to critisize such languages, and incompetent programmers need to understand this. And as long as java is defined that it can produce a negative value when adding 2 positive values, and without *any kind of warning* to the programmer, then it becomes the resposibility of the programmer to understand this, and a programmer that produces a program that fails to check everywhere for this, is an incompetent programmer. Of course the above argument is all a big ballony, but this is the defense people are comming up with to justify this. It looks like when a language is popular, it can do any strange things, and people will still defend it. Rich