[comp.lang.misc] Re^2: Complexity of syntax

john@basho.uucp (John Lacey) (01/08/91)

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:

>In article <1991Jan4.152846.15917@maths.nott.ac.uk> anw@maths.nott.ac.uk (Dr A. N. Walker) writes:
>> 	Well, it *is* a problem.  You have to invent a name.

>Every coding stylebook I've seen recommends that you give names to
>everything. It's a very good idea, you know.

No, I don't know, and I doubt you do, either.  If functions are truly
to be first class objects, they should have the right to be anonymous.
In this sense, neither functions nor structs are first class objects
in C.

Do you really gives names to everything?  Every integer constant,
every string, every character?  Or do you let them go nameless?

Personally, I would prefer Scheme, but the only language everyone on
my project is familiar with is C.  The result is that my code is
sprinkled with dumb 1 line functions, with dumb names, that I need to
declare to pass them to other functions.  They mostly rearrange their
arguments.

>Which is why you choose more meaningful names. Like fxpc, a function
>that adds c to x.

"There are already enough names." Lao Tze

>> but why *not* allow
>> 	z = 2 * sin (theta) * integral ((float x)(blah), 0, pi) + ...;

>Who cares? How about because it's a pain to parse, compile, and read?

So because it makes writing compilers a bit more difficult, we should
abandon it?  Do you do _all_ your coding in machine code?  Like any
other construct, there are good ways to format it, and poor ways.
Using the Scheme method, which requires a lambda construct, makes the
anonymous function clearly visible.
-- 
John Lacey         614 436 3773         73730,2250
john@basho.uucp  or  basho!john@cis.ohio-state.edu

oz@yunexus.yorku.ca (Ozan Yigit) (01/09/91)

In article <1991Jan7.185658.20240@basho.uucp> john@basho.uucp
(John Lacey) writes:

>Personally, I would prefer Scheme ...

Those who are familiar with it, often seems to, not to mention it is
possible to write highly optimizing compilers for the language, so the
usual crowd of nay-saying efficinados ;-) are left behind to dry.

oz
---
Where the stream runneth smoothest,   | Internet: oz@nexus.yorku.ca 
the water is deepest.  - John Lyly    | UUCP: utzoo/utai!yunexus!oz