bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bison function argument style


From: Hans Aberg
Subject: Re: Bison function argument style
Date: Tue, 19 Nov 2002 19:17:41 +0100

At 13:09 +0100 2002/11/19, Akim Demaille wrote:
> Hans> My own opinion about the extra space is that it looks wrong,
> Hans> because it contradicts what typically is used in math.
>
>Well, the day imperative programming and math agree on the semantics
>of ``functions'', we might reconsider our position.

Are you claiming that the extra space is inserted in order to indicate a
difference in semantics? :-)

-- The GNU standard said it was to bring make the code more readable.

>  In the meanwhile,
>just consider that what you name a function and what the GCS call
>functions are merely homonyms.  What applies to one has no reason to
>apply the other.

The reason I write the computer code syntactic construct without extra
space as in math is that it brings out the association of the different
parts, as it should be.

>PS/  We should also consider renaming all the functions f, f', f'',
>and variables are x, y and z, that's common practice in math :)

One difference between math and computer code that I already have pointed
out is that the former often use single letter names, whereas multiple
letter names are more common in computing, probably in part of the lack of
a full symbol set. Multiple combination do occur in math as well, in names
like "sin", "Hom", etc, and there are special rules for typesetting them.
(Individual math letters are not kerned, but names are.)

The computer styles I have seen seem to be dictated by a belief that
imposing restrictions according an ad hoc scheme will increase readability.
For example, writing code in tabular styles is popular. But in typesetting,
tables are thought to decrease readability, except for the sole purpose of
finding tabular entries. Thus, tabular styles should be avoided and only be
used when dictated by circumstances.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]