C programming style

Ken Arnold%CGL arnold at ucsfcgl.UUCP
Sun Jul 21 06:33:56 AEST 1985


In article <74 at avsdS.UUCP> tooch at avsdS.UUCP (Michael J. Tuciarone) writes:
>C may never approach Pascal for sheer readability, but the trade-
>off  made  in  favor  of brevity and richness of expression seems
>well worth the small extra effort invested in learning  to  speak
>the language well.

Mike makes several excellent points in this article (including an
appeal to professional courtesy from all of us professed
professionals), but I think he is being a bit oversimple here.
Readability is not a boolean value, but a vague factor with many
variables.  Some of these are language dependent (I always find APL
nearly impossible to read, for example; others may not, so maybe this
is "programmer+language dependent").  Others are programmer dependent.

C is very readable.  To me, it is more readable than PASCAL, because
its bandwidth of communication is higher, i.e., it uses nearly the full
ASCII set of characters instead of words.  I find it easier to scan C
code than PASCAL code because "and", "begin", "end", etc., have to be
read to distinguish them from variables, whereas &&, {, }, etc. are
easy to tell from variables.  The "richness of expression" of C
contributes to its readability WHEN you know the language.  When you
don't, it hurts.

This doesn't bother me.  The fact that I don't understand how my car
engine works never stopped me from driving it.  It would be nice if I
did understand all the techonology I use so that I can fix it when it
doesn't work, but I don't.  So I don't understand why people expect
programs to be understandable to everyone.  They tried that with COBOL,
and what they ended up with was a still unreadable language that nobody
wanted to program in (not that it stopped the bosses from wanting them
to).
		Ken Arnold



More information about the Comp.lang.c mailing list