mic@lapis.berkeley.edu.UUCP (04/22/87)
Thanks for the large amount of mail received about the question asked recently about the rationale for using C on a PC... It did not answer all of my questions though (see next posting) but surely covered most of them... Here is a summary (in case anybody is interested). Date: Thu, 16 Apr 87 09:16:28 PST From: broman@cod.nosc.mil (Vincent P. Broman) C has an advantage in that many software developers like it, therefore C tools and compilers are rather highly developed under MS-DOS, despite the inimical architecture. Also, C allows enough low level escapes to frob the hardware to satisfy the needs of performance conscious programmers. C has some characteristics of a fad language, except that the popularity of Unix will likely give it continued unnatural popularity. An ANSI standard for C, such as is coming out soon, will help make C more useable. But, then the same should be said for Extended Pascal and Modula-2. From: ucbcad!ames!styx!elxsi!len@ucbvax (Len Mills) Not that bad a question. Yes, C is widely used. No, it's not another Pascal (VERY popular in California Universities; just about dead every- where else). That's not to guarantee that C will last as long as FORTRAN, COBOL, and APL, but it probably will, especially in the areas of OS development and general-purpose programming. Date: Fri, 17 Apr 87 11:48:39 est From: R. Mark Chilenskas <decvax!genrad!panda!teddy!rmc@ucbvax> Basically, C is a "mediocre level language", that is, it has a bit better code and data structuring facilities than assembler, and is more portable. Writing good code still forces you to worry about the machine architecture (will moving this type into that variable sign extend the characters thus forcing me to code some characters as negative numbers for comparisons?) so much of the portability is an illusion (based on moving C programs between many machines with virtually the same architecture [PDP-11, VAX, MS68k, etc. but PDP-10, PR1ME, lisp machines etc. are very difficult and kludgey. Most C fanatics use this as evidence that those machines are obviously no good, as C doesn't run well on them]). Unfortunately, C provides just enough typing to get in the way (unlike, say, Bliss which has all typeless variables and interprets them correctly based on the current operation) without really helping to catch the problems that Pascal, Modula 2 or Ada catch routinely (like array bounds problems, using pointers when you mean arrays, etc.) C is a language designed by a couple of hackers (well, they would style themselves systems designers) in the mid-70s so they could do the job of assembly with less of the hassles. If this appeals to you, then maybe C is OK. But we have learned a LOT about programming in the last decade, and a top-flight ISO Pascal or Modula 2 will permit a lot more useful programming. For myself, i use Lisp, Prolog and Smalltalk for my prototyping, Modula 2 or Pascal for code that needs to run faster or access the machine directly, and C at work when the standards say i have to. C isn't the worst language i have ever used, but the more C code i deal with, the less i dislike Cobol. Date: Sat, 18 Apr 87 15:43:36 edt From: ames!cbmvax!vu-vlsi!colin@cad (Colin Kelley) Of course it all depends on what you want to do, but if you're writing any sort of applications program, C is the way to go. You can often achieve close to assembly languages speeds in C. The real question becomes, WHAT ELSE ARE YOU GOING TO USE?! These are my objections to the other two popular languages: FORTRAN. Give me a break! FORTRAN has no concept of data structures, which is reason enough to rule it out right away. Besides, C is mostly a superset of FORTRAN anyway. PASCAL. Never designed as an applications program anyway; it is useless without extensions. With extensions (like Turbo Pascal) it shares most of C's advantages, but the extensions are never compatible and thus you don't get C's portability. The popular extensions are usually just C anyway! (like 'break', 'continue', 'sizeof' etc...) [Incidentally, most of MS-DOS is now written in C too! Try running a string search program on the external MS-DOS command EXEs, and you'll see lots of messages like "error reading drive %c"...Starting with version 2 of MS-DOS, Microsoft has been adding features to make MS-DOS look more and more like Unix, and this means it fits in very nicely with the standard Unix C library functions...] This is as far to the other side of the country as you can get. And C is certainly not a fad. I've been job interviewing with many engineering companies, and most are switching from FORTRAN to C. And the reasons are: portability and efficiency. I find when looking at my C listings (the ones that show the assembly language interleaved with the source code) that most C operators compile to a single 8088 instruction! That's not surprising. C corresponds almost perfectly to the instruction sets available on most current processors (8088, 68000, 32000, VAX)...There's no other language available that even comes close. Personally, I think C will continue to be the ultimate language for Von Neuman machines, not because it's perfect, but because it's so much closer than anything else. I'm not naive enough to think that C will last forever though, since the current VN architectures will probably be replaced by some sort of parallel architecture(s) in the future... Date: Sun, 19 Apr 87 23:20:38 MEZ From: Johan Vromans <decvax!seismo!mcvax!mhres!jv@ucbvax> Whether you consider C to be a structured assembler or a high-level programming language is not important. Programming in C is: - easier than assembler - fast enough - yields programs which CAN be understood by others - programs which MAY be portable to other machines - can make use of symbolic debuggers (e.g. MS Codeview) - and the language is defined, so everyone knows what you are talking about Date: 20 Apr 87 10:44:14 EDT (Mon) From: ames!eddie.mit.edu!allegra!bentley!angel@cad (A Gomez) I think you will find most (if not all) major applications written in C these days. This is both on UNIX and MSDOS. The reason, of course, is that MSDOS is very much like a single tasking UNIX system and the libraries can be made to match. This allows portability between high and low machines, multitasking or not.