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, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bd45e29f9dafca87 X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: bitwise comparators Date: 2000/01/18 Message-ID: <86203i$947$1@nnrp1.deja.com>#1/1 X-Deja-AN: 574218624 References: <3880D375.7E363123@hotmail.com> <38829638.0@news.pacifier.com> <3882FC1C.2BA8C959@hotmail.com> <85vmn2$ki1$1@nnrp1.deja.com> <38836CF2.AB738B8B@hotmail.com> <85vr1s$9qe1@news.cis.okstate.edu> X-Http-Proxy: 1.0 x41.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Jan 18 15:16:18 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.6 [en] (WinNT; I) Date: 2000-01-18T00:00:00+00:00 List-Id: In article <85vr1s$9qe1@news.cis.okstate.edu>, dstarner98@aasaa.ofe.org wrote: > On Mon, 17 Jan 2000 20:26:42 +0100, Alexander Van Hecke wrote: > >This seems like an attack on C/C++! I'm sorry, but I have to react on this > > > >> Ada has > >> packages, > > > >C was ment to be used modular and for reuse : put your code in > >separate .c and .h files. > Its tough to keep a straight face while reading this. You must not have used the packging features of languages like Ada and Modula much to make this statement. There simply is no comparison in the amount of modularity and reusability between them. > int mktemp() can conflict with something in another file. No use of > header files can fix that. A real-world example: We are using vxWorks here at work. xvWorks has no processes, every task in the system is effectively a lightweight thread. You can kind of think of the entire system, kernel and all, as one big program. We had some C code to handle reading of radio database files developed for previous projects that we decided to reuse in our system, rather than rewrite it in Ada (a quite sensible decision). When we took this system out to the hardware, we had a devil of a time getting networking to do anything. We eventually discovered that we couldn't even ping the loopback address succesfully. That made no sense whatsoever. After a couple of days, one of the engineers found the problem. This completely unrelated reused C code of ours had a routine named "checksum". Apparently, the TCP/IP stack *also* has a checksum routine, and they are not the same. Now a longtime C programmer would probably be indignant that neither author used the standard idiom (aka: hack) of tacking on some kind of namespace designator to the front of the routine's name to prevent this kind of disasterous clash. But the engineer in you should realize that it is silly to yell at someone for screwing up when they have been presented with an error-prone system in the first place. Someone was *bound* to screw up eventually. In Ada this won't happen, because in Ada everything automaticly has its package's namespace, and the default is *not* to export the symbol to the system. If there is a namespace clash, the code won't compile in the first place. So we *never* have any such trouble with our Ada routines. -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.