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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1014db,dab7d920e4340f12 X-Google-Attributes: gid1014db,public X-Google-Thread: 10d15b,d730ea9d54f7e063 X-Google-Attributes: gid10d15b,public X-Google-Thread: 103376,dab7d920e4340f12 X-Google-Attributes: gid103376,public From: Craig Franck Subject: Re: C is 'better' than Ada because... Date: 1996/08/12 Message-ID: <4um08t$klq@mtinsc01-mgt.ops.worldnet.att.net> X-Deja-AN: 173597281 references: <31f3c52e.238719470 <4uj42h$j06@mtinsc01-mgt.ops.worldnet.att.net> <4ukl9r$gcj@news.inetdirect.net> <4ul434$jf@mtinsc01-mgt.ops.worldnet.att.net> <4ulpn9$ka6@news.inetdirect.net> content-type: text/plain; charset=us-ascii organization: AT&T WorldNet Services mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.c,comp.lang.cobol x-mailer: Mozilla 1.22ATT (Windows; U; 16bit) Date: 1996-08-12T00:00:00+00:00 List-Id: dlmiller@inetdirect.net (Doug & Rose Miller) wrote: >Craig Franck wrote: >+dlmiller@inetdirect.net (Doug & Rose Miller) wrote: >+>Craig Franck wrote: >+>+Richard Riehle wrote: >+>+I agree with that, if you include PC programming as "a certain class of >+>+problems". Most PC OS's are written in C/C++. It makes sense that >+>+applications would then be coded in C/C++ as well. >+> >+>This is absolute nonsense. IBM mainframe operating systems are (or at >+>least were, during the time I worked with them) written in assembly language; >+>by this "reasoning," application programming on IBM mainframes should >+>therefore also be done in assembly language. >+ >+While it might not be in your mind a compelling argument, I dont believe >+it is nonsensical. Having programmed for Windows in C/C++, Pascal as well as >+BASIC, I feel that C/C++ is the most natural. > >Perhaps. But this has absolutely nothing to do with the language in which >the OS was written. How could it? The OS isn't executing source code. It's >executing object code, and you can't tell what the source language was, >by looking at the object code. > How could it? The fact that all the API functions want NULL terminated strings is a clue. So when you want to pass a string from a Pascal program, you can't pass it a string with the length embeded in the first element of the string/array. The fact that you need a new keyword in BASIC because it expects things to be passed by value. I know it's all just 1's and 0's when its object code, but to interface with the OS you must call API functions, and it's there where you must deal with the language that the OS is written in. Subroutine linkage is language specific. So yes, you at least need to know what that should be. Fortran, BASIC and Pascal have similar linkage. C does not. >+ When you are using the >+same tools the vendor used to write the OS your going to be using a good >+implementation. > >I'm completely baffled as to why you think there's any connection. Because my C++ compiler and assembler both come from Microsoft. Look, it helps because I can do things like write custom controlls and DLL's that act as part of the OS and thus extend it. So don't be baffled. I think there is a conection because in my case, there is. This would not be true in a general sense, but Microsoft is an 800 pound gorilla, and if you do things their way, then when they upgrade thier OS your programs still run on that platform. Which is real important. >+ Theoretically you could program in any language. The >+question is how can I get the most done? I have a bias towards these >+types of implementation because they have worked well for me in >+the past. Perhaps your experiences have been different. >+ > >Not only different, but a little broader, too, I'd suspect. Sounds to me >like your experiences have been limited to a single platform. Actually, a small number. DOS/Windows is what I develope seriously on. >+ >+>What possible connection is there between the language used to write an >+>OS, and the language in which the applications which run under it are written? >+ >+It seems that those languages have the best implementations. And yes >+if the OS is written in assembler, you are better off with a HLL for that >+is the best way to leverage your time. >+ > >You just contradicted yourself, you know. Earlier you said "When you are using the >same tools the vendor used to write the OS your going to be using a good >implementation." Now you say that a high-level language is the best application >environment when the OS is written in assembly. That may seem like a contridiction. Its interesting that you brought up mainframes running OS written in assembler. If there is not a HLL in which to write the OS go with assembler and write compilers for COBOL, or PL/I or FORTRAN or whatever. Anything but assembler. I don't know what MVS running on an ES/9000 is written in. I know AIX is a UNIX clone so I would assume its written in C. So what do you think? Someones going to develop in assembler just because it's a could implementation? That would not be the best way to leverage ones time as a programmer. But assembler is the exception, not the rule. >And whether you are better off with a HLL or assembly depends entirely on >the problem you are solving, and has absolutely nothing to do with the language >in which the OS was written. > That not true! DOS was written in assembler. In the beggining you needed an INT 21 to interface with the OS. You could buy a C compiler but if you looked at the source for the library functions, the ones that called the API were all part assembler. Now if you didn't say "depends entirely" I would have agreed with you because your statement is true in a general sense. You are correct that the problem should determine the solution. But there is legacy code. Is AT&T going to rewrite or start coding all their switching systems in Ada just because it's "better"? I dont think so. I only threw that in at the last minute because the name of this thread is C is "better" than Ada... :-) Craig ----- clfranck@worldnet.att.net Manchester, NH There are no electrons...