[comp.lang.c] Why Program in C?

pjh@mccc.UUCP (Peter J. Holsberg) (01/23/88)

I am frequently asked by people who write programs for the IBM PC-type
computer, "why C?".  Rather than give a "book" answer, I thought I'd ask
you professionals.  Why do *you* program in C?  Where does it offer
advantages over other languages?  Thanks.
-- 
Peter Holsberg                  UUCP: {rutgers!}princeton!mccc!pjh
Technology Division             CompuServe: 70240,334
Mercer College                  GEnie: PJHOLSBERG
Trenton, NJ 08690               Voice: 1-609-586-4800

cjc@ulysses.homer.nj.att.com (Chris Calabrese[rs]) (01/25/88)

In article <147@mccc.UUCP>, pjh@mccc.UUCP writes:
> I am frequently asked by people who write programs for the IBM PC-type
> computer, "why C?".  Rather than give a "book" answer, I thought I'd ask
> you professionals.  Why do *you* program in C?  Where does it offer
> advantages over other languages?  Thanks.


This is just the sort of thing that I've been asking myself recently,
especially with all the discussions about the proposed standards which
have come up recently.

My anser is both simple and complicated.

The simple part is this: C offers me a wealth of standard
libraries on which to draw, all my collegues know C,
so they can understand/dubug/maintain my code, and
it's the official language of AT&T (I work for Bell Labs), and of
UNIX (the only type of machine around here.

The complex part is this: C lets me do anything I want, and however
I want to do it.  I know that a lot of people have been complaining
about the = vs. == operators, but the whole idea of the language is
that these are _two_different_operators_!!!

If I put if(a=b) into my code, it's because it belongs there!!
If you get confused by this, you shouldn't use C!!

Remember, if(a=b) returns true for b != 0; similarly,
	for(i=0; *(c+i); i++) ;
is a perfectly good loop, it calculates the length of the string c.


In conclusion, if you have trouble with confusing these two things,
use some #define statements to clean up your problem, but don't
try to change one of the best features of the language and eliminate
its power.

	Christopher Calabrese
	AT&T Bell Labs
	ulysses!cjc