[net.lang.c] Random C comments

mem (10/28/82)

c
A few random C comments.  Sorry, braces are involved in a couple of them.

There was a suggestion that braces be hidden since braces are only
significant to a machine, not humans.  Alignment of braces is done
BECAUSE braces are significant to the machine, and the human has to
make sure he can understand what the machine is going to make of them.


End of braces.  I think.

All this talk about 24-line screens leads me to wonder, how many
(hmm, I hope nobody thinks I really want to know HOW MANY) people
compose their programs on the screen?  I, if you care, tend to
do my organization on paper, writing pseudo-programs which if 
simple get translated on the screen, if not get translated to
almost-code on paper.  With braces.

There was a comment which said that C-source formatters aren't
nice things because, among other things, they have to be kept up
to the language, whichever one you have.  Perhaps this is a
job for the compiler?  (An aside.. I have thought it a deficiency
that C doesn't give you a compiler-generated listing, like PL/I
or some PASCALs (ugh, I actually refered to PASCAL).)  While I'm
dreaming about compiler features, another nice thing to have a C
compiler do would be to translate all the nice structure, union,
and maybe global variable definitions to the local assembler
language equivalents, so as to make C/assembler interfacing
easy and maintainable.  (Another aside, I had to take a few days
a couple of weeks ago to write a program which does that...) 

Mark E. Mallett

goutal (11/02/82)

Mark reminded me of something about pretty-printers and all that.
He mentioned that perhaps pretty-printing was a job for the compiler,
in order to make it easier to keep the pretty printer up to date with
the language that the compiler will compile (Wow!  I said all that? @mem)
  When I first heard about yecclax, I immediately started dreaming about
all the wonderful stuff that could ensue by making compilers that way --
suddenly, the first pass (or two, depending on your point of view) of
the compiler could also be the first pass of a pretty printer, or a
syntax-directed editor, or a high-level debugger, or a program synthesizer,
or a flowcharter, or all KINDZA stuff!
  It appears, however, not to have worked out that way.
Can anybody explain to me why not?
  If this discussion should migrate elsewhere,
I will glatefully accept directions.
-- Kenn (decvax!)goutal