more about programming style

Don Steiny steiny at scc.UUCP
Mon Jul 15 07:34:14 AEST 1985


>
> and if you don't know C you have no business trying to
> understand it.
> 	Wayne

	Really, do you want me to be out of a job?  

	I think that standards of correctness are determined
by the massive amount of existing C.   The ++ convention is
easy for me to understand.   An example is variable names.
People who come from other backgrounds than C programming
often use long variable names, for instance:  

	char	*name_array[];
	int	name_array_index

A C programmer might declare

	char	*names[];
	int	i;

Supposedly this is harder to understand.   In the book "Learning
to Program in C" by Thomas Plum he mentions that they looked
at a bunch of C code and found out that 90% of C programmers
use i and j as index variables.  If people write programs
that are unconventional C, they get hard to understand (the V7
Bourne Shell, for instance).    One can use C macros to make
their code look like other languages.  The worst I have seen
is programs by people whose first language was Fortran.  I have
written simple programs that will compile with either the
C compiler or the F77 compiler.  It is possible to use lots
of goto's in C, but, why?   

Instead of trying to make C like COBOL, Pascal, or Fortran,
why not learn all of the languages and use whichever one is
appropriate to the task?   



More information about the Comp.lang.c mailing list