If C is so evil why is it so successful?

Ian S. King isking at uw.edu
Wed Apr 12 11:24:37 CDT 2017


Weighing in on the C vs. assembler subthread: modern processors are like
exotic sportscars, in that pretty much anyone can drive the thing to the
corner grocery but it takes a lot of skill to get the best performance out
of it.  Load/store superscalar architectures benefit enormously from
various tricks that optimizing compilers do.  Sure, you can code those
tricksk in assembler, but for any program other than the most trivial it
becomes a daunting task.

Compiled C also supports writing sustainable code.  Use as many
intermediate variables as you like to clarify what your code is trying to
do - the compiler will optimize them out of existence.  This can make
troubleshooting more difficult, but that's why you turn off the
optimization for debug builds.

C vs. anything else?  I think John Wilson was spot on, it's like a
motorcycle and if you don't know what you're doing you can hurt yourself.
Personally, I usually use Python for application code and C if I'm doing
something down 'on the metal' that has to be performant (e.g., device
drivers).  -- Ian

On Wed, Apr 12, 2017 at 9:15 AM, Rod Smallwood via cctalk <
cctalk at classiccmp.org> wrote:

>
>
> On 12/04/2017 16:08, Norman Jaffe via cctalk wrote:
>
>> Assembler is a sports car kit.
>>
>> From: "cctalk" <cctalk at classiccmp.org>
>> To: "cctalk" <cctalk at classiccmp.org>
>> Cc: jnc at mercury.lcs.mit.edu
>> Sent: Wednesday, April 12, 2017 7:57:07 AM
>> Subject: Re: If C is so evil why is it so successful?
>>
>> From: Alfred M. Szmidt
>>> No even the following program:
>>> int main (void) { return 0; }
>>> is guaranteed to work
>>>
>> I'm missing something: why not?
>>
>> Noel
>>
>> PS: There probably is something to the sports car analogy, but I'm not
>> going
>> to take a position on that one! :-) Interesting side-question though: is
>> assembler more or less like a sports car than C? :-)
>>
> All computer computer languages are only as good or bad as the person
> using them.
>
> Rod
>
> --
> There is no wrong or right
> Nor black and white.
> Just darkness and light
>
>


-- 
Ian S. King, MSIS, MSCS, Ph.D. Candidate
The Information School <http://ischool.uw.edu>
Dissertation: "Why the Conversation Mattered: Constructing a Sociotechnical
Narrative Through a Design Lens

Archivist, Voices From the Rwanda Tribunal <http://tribunalvoices.org>
Value Sensitive Design Research Lab <http://vsdesign.org>

University of Washington

There is an old Vulcan saying: "Only Nixon could go to China."


More information about the cctalk mailing list