From: swaim@owlnet.rice.edu (Michael Parks Swaim)
Newsgroups: alt.folklore.computers,comp.unix.misc
Subject: Re: The need for an assembler (was: Favorite CPU)
Date: 27 Aug 1992 21:13:52 GMT
Organization: Rice University

In article <1992Aug27.081510.17085@news.columbia.edu> lasner@watsun.cc.columbia.edu (Charles Lasner) writes:
>In article <BtLt4o.45G@rice.edu> swaim@owlnet.rice.edu (Michael Parks Swaim) writes:
>> Someone who writes code without
>>thinking about where he's going is sloppy, and will generate lots of 
>>interesting bugs.
>
>That seems to describe a fair segment of existing C programmers apparently.
>Not all, but an alarming percentage that isn't insignificent.

  C programmers, or programmers in general? I'd say that people who write in
BASIC or Pascal are just as sloppy.


>>  That's because assembly's generally harder than C.
>
>This is the first time someone used that word.  So, this would imply that
>C is to be used as an "easy way out" of getting "something" to work even if
>it's not necessarily the "best" thing.  In other words, to advance the art of
>mediocrity and expediency and "close enough for government work".

  But do we need the "best" thing? Using a compiler, I can usually get a good
approximation much faster. Usually, that's good enough. If it's not, I
learn a new language.

>I'm not advocating any form of panacea, just that *some* work is done in a
>questionable way, and using C in the process.

  That's because C's the "in" language. Before that was Pascal ("Ooh, 
subroutines!"). Before Pascal, BASIC was the it on small machines. It's
not the language, it's the people. They're going to write sloppy code
no matter what language they use.


>I have no problem with this: you made a conscious decision to trade off
>something.  There are people on this group that will claim that their use
>of C represents no tradeoff whatsoever, and to the contrary are guaranteeing
>an improvement.

  It depends on how you code. Many of the optimizations compilers make
are things that the programmer could have done himself. This doesn't 
necissarily mean that the programmer's sloppy, either.

>>  On the other hand, any programmer should have SOME idea of why the machine
>>works the way it does. Not necissarily being a competent assembly programmer,
>>but understanding tradeoffs in the system architecture.
>
>Why bother? When you are ignorant about the existence of tradeoffs, you can
>fantasize about how good your program runs :-).

  But knowing the system architecture isn't the same as knowing assembly.
Caches can have enormous impact on how a program runs, but knowing assembly
won't help you deal with them in itself.

>> I don't think that C
>>or assembly is the "best" language most of the time.
>
>I have no big problem with the last statement, but apparently many of the
>more vocal people on this group will differ with you, as they view C as
>both perfectly optimal and a virtual panacea.

  Not optimal, but good enough most of the time. They're vehement because
you're vehement. I try not to be vehement because I've been wrong, and
it's embarrasing.

>cjl



-- 
Mike Swaim            | I can see clearly now my brain is gone.
swaim@owlnet.rice.edu | I can see all the bicycles in my way.
Rupp doesn't even know who I am,
 much less care what I think
Xref: sparky alt.folklore.computers:13048 alt.religion.computers:547