More about programming style

Mayank Prakash AI.Mayank at MCC.ARPA
Thu Jul 11 08:03:24 AEST 1985


>From: DHowell.ES at XEROX.ARPA
>Subject: more about programming style
>
>Ok, let me clarify a few things here.  By "idioms", I mean a piece of
>code in a language which can be directly translated into another piece
>of code in that ame language and looks similar in syntax to the same
>piece of code in many other languages.  This would include i++ for i = i
>+ 1 and if((a=b)==c) for a=b; if (a==c).  Idioms are language-specific.
>These are the idioms that I would avoid to make programs more readable.
>
.
.
.
>program is fixed, and we all live happily ever after.
>
>I know this was a rather long story, but I had to get my point across
>somehow.  Remember that the "I" in that story could be someone you will
>be working for.
>
>Dan

Aren't you really saying that all languages should follow the syntax of Pascal.
Since Pascal uses i := i+1, that is how all languages ought to be. The next
thing you would say is that I don't know any programming, but if I can't debug
this large complex program (written in any language), then it is poorly written
program and uses obscure idioms etc. etc. The point is, each language has the
right to have its own syntax, and conventions and whatever. While you may like
one syntax over another, you certainly cannot blame programmers for using those
elements of a language yuo don't like. Remember to a large extent, the whole
subject is very subjective, and is really a matter of what you are used to more
than anything else. If you had been brought up in the C tradition, you probably
would have taken the opposite sides.

Note: I am not an expert C programmer, nor am I trying to defend idiosyncracies
of C (such as i = i++), but I would certainly agree with the C experts on this
issue.

- mayank.

-------



More information about the Comp.lang.c mailing list