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: 103376,1042f393323e22da X-Google-Attributes: gid103376,public From: NKSW39B@prodigy.com (Matthew Givens) Subject: Re: Any research putting c above ada? Date: 1997/04/16 Message-ID: <5j18h3$1564@newssvr01-int.news.prodigy.com>#1/1 X-Deja-AN: 235144913 Distribution: world References: <5ih6i9$oct$1@waldorf.csc.calpoly.edu> <5ijb0o$ajc@ns1.sw-eng.falls-church.va.us> <334d3da5.14386594@aplcen.apl.jhu.edu> <2senchydgk.fsf@hpodid2.eurocontrol.fr> <5im3an$3dv@bcrkh13.bnr.ca> <33526cbf.41c6@cca.rockwell.com> <5iusvd$118e@newssvr01-int.news.prodigy.com> <33530e22.5940@worldnet.att.net> Organization: Prodigy Services Company 1-800-PRODIGY Newsgroups: comp.lang.ada Date: 1997-04-16T00:00:00+00:00 List-Id: "James S. Rogers" wrote: > > >Even in C it is not a good thing to assume an integer is an integer. >A pointer value is an integer. No experienced C programmer would >multiply a vote count with a pointer value, assigning the result to >the pointer. Speaking of pointers as integers, what about that special >pointer value 0? Why are there no negative pointer values? After all, >an integer is an integer. If you look closer, a pointer is NOT a strict integer value, especially when dealing with the segmented PC architecture. And the compiler enforces that with the "different levels of redirection", I believe the message goes. Then again, I haven't gotten that message in quite a while. Luck? No, just that advanced use of pointers is second nature to a proficient C programmer. And care when using pointers is the first thing taught. Although I might (and have) get pointers pointing to weird places, I don't try and do mathematical calculations with them. > >Why is there a difference in the C specification between characters and >longs? Certainly they are both forms of integers in C. They must, >by your logic, be completely inter-convertable. Again, a character is a different creature from a long integer. Yes, you can mix them, and there's nothing wrong (in and of itself) with doing so. So far, you've proved my point. All your arguments assume that the programmer works well in a rigid, strongly-typed environment. I do not. I work much better when I can mix and match the types as I need to do so, without a lot of extra programming to make it work. Different personalities, different capabilities, different languages. > >Of course there are different types which use any integer-like >representation. That does not make the types even approximately >compatible. Incompatible types should not be masked by using one >single integer representation for all of them. Of course not, and I don't. But judicious use of type mixing is fine. My favorite example is converting to lower case: 'A' + 32. Simple and easy, in C. > >Strong typing as found in Ada can be difficult to deal with. It can >be difficult because it forces the designer to understand the >behavior and limitations of the design in great detail. Weak typing >allows the designer to ignore many behavior and limitation details. >When design ignores behavior and limitation details the door is opened >for catastrophic failure. It is usually very difficult to detect these >problems in formal testing, leaving major defects in the delivered >product code. Such defects are more and more frequently exposing >software developers to serious legal actions including criminal charges >and civil suits. Blaming such problems on the language is short sighted, don't you think? I used to know a guy who couldn't write "hello world" in basic without crashing the computer, but could write rings around me in C. Good programmer, with good programming and debugging habits. And that's what it's all about, right? We should all develop good programming habits in whatever language we choose. Jim, my point is that diversity is a good thing, not a bad one. The C language has it's place, as does Ada. Don't make the mistake of trying to classify one as "good" and the other as "bad", because it's all in your assumptions. My assumptions are that ease of use, versatility, and a relaxed environment are good. Yours are that a rigid environment helps the programmer avoid stupid errors and concentrate on writing programs. Well, my assumptions work for me, and yours work for you. Why try and muck things up by tagging one "better" than the other? - "Outside of a dog, a book is a Man's best friend. Inside of a dog it's very dark." << Iceman >>