This is not net.lang.algol

COTTRELL, JAMES cottrell at nbs-vms.ARPA
Fri Oct 4 08:36:49 AEST 1985


/* Ray Lubinsky writes:
> Dan <DHowell.ES at Xerox.ARPA> writes:
> > Personally, I don't really like the {} braces of C, nor the "begin..end"
> > of Pascal and its relatives.  This is one thing that Ada has going for
> > it with its "if..then..endif" style.
> > 
> > I like to use these definitions:
> > 
> > #define IF if(
> > #define THEN ){
> > #define ELSE }else{
> > #define ENDIF }
> > 
> > (Gee, I should write my own language)
> 
> Yes, indeed.  Or at least stop pretending that you're programming in C. I make
> a lot of use of the compiler macro facility, but I've always thought that
> screwing around with the appearance of the language like this is a real
> abomination.

Believe it if you need it, if you don't just pass it on.
 
> Any body have a source license so that they can dig into the code of Bourne's
> shell?  No offense to Bourne (his shell is one of my most-used programming
> environments), but the code is a mess of defs like DO .. OD, LOOP .. POOL,etc.
> I fail to see the advantage unless one is incapable of learning a new language
> and is forced to under-utilize C by thinking of it as something else.

The thing about Bourne is that HE DID IT RIGHT!!! The standard, 
canonical, ordained by god way of expressing an IF statement is:
	IF condition THEN true-part [ ELSE false-part ] END
Whether you want to call the END token FI or ENDIF I don't care.
The one-statement model is brain-damaged and leads to mismatched else
statements and/or begin/end or {} kluges. Even the C Preprocessor uses
an explicit #endif. Bourne may have gone a *little* overboard (e.g. his
`#define ANDF &&' & END will suffice for POOL, ESAC, & OD) his include
file for the shell is a pretty close model for `handy.h'.

> When I program in Pascal, I don't use a macro preprocessor so that I can make
> the program look like C.  

If I had to program in TRASHCAL I would use *anything* to make it look
like something else.

> If I want to use C, then I use C.

I don't program in C, I program in JC. I'm god in my own universe.
After all, programming is just a game. Why not make up your own rules?
It's all a dream we dreamed one afternoon long ago.

	jim		cottrell at nbs
*/
------



More information about the Comp.lang.c mailing list