Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!snorkelwacker.mit.edu!stanford.edu!rutgers!ucsd!ucrmath!gibson!rhyde From: rhyde@gibson.ucr.edu (randy hyde) Newsgroups: comp.sys.apple2 Subject: Re: CRCs Message-ID: <13769@ucrmath.ucr.edu> Date: 23 Apr 91 00:06:22 GMT References: <13688@ucrmath.ucr.edu> <15915@smoke.brl.mil> Sender: news@ucrmath.ucr.edu Reply-To: rhyde@gibson.ucr.edu (randy hyde) Lines: 47 You keep claiming it isn't fair to compare an assembly language code routine to a C routine when the assembly language code doesn't support C linkages. Why would someone writing their code in assembly language use such linkages? Of course if you were writing a single routine to link into a big C program. But I'm talking about someone writing the entire program in C. Clearly a small program is easier to manage and understand, regardless of the language. But the performance benefits of small programs side with HLLs as well. In the CRC example I have, the ASM program was only twice as fast as the C version. My experience on the 8086 is that the larger the program, the larger the performance difference. This is being reduced on newer processors as companies like Motorola and Intel optimize their instruction sets for those 30% of the instructions that ***C and Pascal*** compilers use. It's still true in general though, that as the program gets larger, so does the speed difference. So far, my experience with well-written C programs and well-written asm programs is that they're both easy for me to understand (regardless of the size). The only problem is that very few people write well-written C or ASM programs. Don't try to tell me it's easier to write well-written C programs. My experience shows that either (1) it is not, or (2) C programmers aren't as good as ASM programmers because even though it's easier, they don't write better C programs. Most C programs are a mess. I don't want flames from people saying "*I* write easy to read C programs." Anyone can post a single example. In general, few people (including myself) write easy to read and understand C programs all the time. I can't comment on which is worse, a poorly written C program or a poorly written assembly language program. They're both really bad. >> I recommend C... for the majority of projects... Surprise! So do I. Commercial software products is the one area where I draw the line though. Most projects are not commercial (by my definition, mass market consumer) products. This is a situation where performance is more important than portability and, arguably, more important than maintainability. Actually, I should revise the above statement, I don't recommend C for the majority of projects, actually I recommend an appropriate HLL for the job; this is not always C. Most projects I recommend languages for are not in the class of commercial products. *** Randy Hdye