[net.lang.c] subject

cottrell@nbs-vms.ARPA (02/12/85)

/*
> Why do you enclose your postings in  /* */?  Just curious.
> 
> Peace
> 
> 		Josh Knight, IBM T.J. Watson Research
>     josh at YKTVMX on BITNET, josh.yktvmx.ibm on CSnet,
>     ...!philabs!v1!josh

Most people include a little snack for the line eater and a cute little
signoff line. Since what I write are `comments', it seems appropriate
to include them in /**/. You will know I have switched to Pascal when
you see my messages enclosed in (* *) (and when hell freezes over)
(oops, better check with my censor at Princeton). Also, if the `/*'
is missing, you can assume my entire message didn't make it.
*/

tainter@gumby.UUCP (02/15/85)

[Eaton? Good school?]

> /*
> Since what I write are `comments', it seems appropriate
> to include them in /**/. You will know I have switched to Pascal when
> you see my messages enclosed in (* *)
> */
BUT,  when will you be using -- Such as this (Lovely isn't it?)
ADA comments ?

cottrell@nbs-vms.ARPA (02/20/85)

/*
Jon Mauney writes...

> COMMENT
>   I will refrain from pointing out that the given example uv type punning
>   in C (doubly linked lists) is really a kludge to get abstract types
>   and jeneric funkshuns in a languaj that doesn't support them.

I guess. The example I gave seems to work pretty well, & even seems
readable. I always use typedefs and NEVER do the words int, long,
char, struct, etc appear anywhere except typedefs (or if I'm lazy).
The abstract type manipulation of links, heads, is well defined and
isolated. With a few casts, even Doug, Guy, & Joe should be pleased.

>   However I cannot refrain from pointing out yet another piece uv 
>   empirical evidens to show that the C languaj and its tradishuns
>   encouraj the writing uv unreadable code. To wit, the funkshun
> 
> > LINKP insque(LINKP p,LINKP q);	/* insert p after q */
> > {	if (p)	(((p->fwd = q->fwd)->bwd = p)->bwd = q)->fwd = p;
> > 	return(p);
> > }
> > 

Okay, I'll reveal my true colors! I'm a fan of terseness. To the max.
Gag me with verbosity. I like APL, & TECO. The less chars in a program
the better! With sufficient mnemonic choices, one char will often 
suffice. Knuth always used 'p' & 'q' for nodes. One of the
distinguishing features of C (relative to general purpose languages,
not weird/neat ones like APL & LISP which also have this feature) is 
that the assignment operator returns a value which can then be acted 
upon as an expression. This isolated, debugged funxion stands as a
testament to the power of the language and virtuosity of the coder
without getting in the way of higher level fns where clarity is more
important. It's a primitive. Make those fns short tho.

>   I also won't say anything about imajinativ speling.
> TNEMMOC

BTW, `language' is misspelled `langwij'. I like the letter X.
It usually makes words shorter. In short, like to have FUN in what
I do. I make up my own rules. Some of them are pretty good. You know
what I mean.

Doug Gwyn writes...

> Now, that's not fair!  Cottrell (the guy whose example you used) has
> been railing against the very things that those of us who appreciate
> readable, portable code like.  

Only portable, Doug. I like readability. I have my own stds tho.
While some would call by style cryptic because of its terseness, excess
verbosity can obscure the meaning as well. My goal is to modularize &
format code so that the meaning is obvious `by inspexion'. That's my
GOAL, not always the RESULT! Axually, my code is relatively portable
as well, but only to `regular architectures'. Axually, the world IS
looking more & more like a VAX as time goes by. You must remember this...
How about a compromise? I'll write non-portable (in the abolute sense)
code, but run it thru lint and clean it up before poting to net.sources.

> I could show you worse examples in
> almost any language you name.  One can't solve these problems through
> language design alone.
> There is a serious effort underway to (a) improve the C language, and
> (b) establish new traditions for its effective use.  We hope that the
> average quality of C code will improve as a result.

I don't know whether to thank you for defending me or be offended.

	jim
*/

cottrell@NBS-VMS (03/07/85)

/*
> #define MSB (~(-1>>1))
> 
> Well know we know /* */'s name is Jim, anybody know what machine he is
> on. If only he would learn how to program and/or sign his path.

1) I didn't post the question, just the answer
2) Your solution doesn't work
3) You are a twit.

Even `~(((unsigned)(~0))>>1)' (the portable solution) doesn't work on V6.
Evidently the compiler gets confused about unsigned constants. Replacing
the cast with `x=' (where x has been declared unsigned) does work tho.

I thought the mailer would include the return address, so I never gave 
it. However, this is not the first time I have seen a request for my
rtn adr from a uucp site. I now give it as a matter of course. We have
VAXen running VMS (yuk), 4.2BSD, a SUN, VME/10 (68K) SYS V port. There
are lots of other machines at The National Bureau of Standards.

	jim		cottrell@nbs
*/