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.6 required=5.0 tests=BAYES_05,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: 103376,fee8802cc3d8334d X-Google-Attributes: gid103376,public X-Google-Thread: 10a146,fee8802cc3d8334d X-Google-Attributes: gid10a146,public From: Marin David Condic Subject: Re: Ada and Java. different behaviour. casting long to int problem. Date: 1999/06/15 Message-ID: <3766C842.E1EAB60A@pwfl.com>#1/1 X-Deja-AN: 490014235 Content-Transfer-Encoding: 7bit Sender: condicma@bogon.pwfl.com References: <7jt2c0$vrb@drn.newsguy.com> <7k57vb$1ipf@drn.newsguy.com> <3766650F.705125B7@pwfl.com> <7k64t7$igo$1@its.hooked.net> <7k689a$ci2@drn.newsguy.com> Content-Type: text/plain; charset=us-ascii Organization: Pratt & Whitney Mime-Version: 1.0 Reply-To: diespammer@pwfl.com Newsgroups: comp.lang.ada,comp.lang.java.programmer Date: 1999-06-15T00:00:00+00:00 List-Id: rich@nowhere.com wrote: > > 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. > Spending time transferring blame is one of the least productive activities known to man. The people burnt to a crisp in the crash of an airplane aren't going to care that "The Programmer Should Have Read The Standard Better." Dead is just as dead if it was the compiler that was at fault. What the programmer *should* do is mostly irrelevant. What the programmer is *likely* to do is go with all of his years of grade school arithmetic and casually believe that X := X + 1 will yield the expected result. > > 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. > Blaming the programmer doesn't make the bugs not happen. Its like having loose carpeting on the stairs and when someone trips and breaks their neck, we stand around saying "He should have looked where he was going." The poor dumb bastard is dead, dead, dead, and a couple of carpet tacks would have prevented it. > 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. > And again, a *competent* assembly language programmer wouldn't make mistakes in doing math in assembly language because the hardware behavior is very thoroughly defined. Yet ever since Adam bit the apple, we've all been plagued by bouts of stupidity and maliciousness. The latter is something a language can do little about, but the former we can take action against. Why do we build electrical connectors that can only be put together one way? Because if there are *two* ways to do it and one of them is wrong, sooner or later someone will plug them in together the wrong way. Calling them incompetent doesn't unplug the connectors and get them right, nor does it put back all of the smoke that was let out of the electronic device. > 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. > Good argument. I hereby bestow upon you the rank of Devil's Advocate, First Class, with Oak Leaf Clusters. :-) MDC -- Marin David Condic Real Time & Embedded Systems, Propulsion Systems Analysis United Technologies, Pratt & Whitney, Large Military Engines M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600 ***To reply, remove "bogon" from the domain name.*** Visit my web page at: http://www.mcondic.com/