[comp.lang.forth] Naming conventions

Mitch.Bradley@ENG.SUN.COM (Mitch Bradley) (05/25/91)

> > "Cuteness" contributes to Forth's reputation as a difficult-to-
> > read language.

> I couldn't agree more.  JOT sounds like one of those "cute" three letter
> words that people come up with so that the source code is "shorter".
> However, NUMBER-BUF is not much better (IMHO), because of my aversion to
> hyphenated words.

What are the reasons for your aversion to hyphenated words?

The trouble with short names in large programs is that "generic" names
tend to be ambiguous.  For example, if you shorten READ-FILE to just
READ , then what do you do about READ-LINE .  Verb-Object and Adjective-Noun
forms are clear and explicit, and explicitness is very helpful for long
term maintenance of programs by multiple people.

> Now #BUFFER might work if you don't have a preconceived notion about
> the # sign, but I'm sure someone else would dislike it also.

Forth programmers used to F83 might think that #BUFFER signifies the
number of characters in the buffer, not the buffer itself (cf. #TIB ,
#OUT , #LINE ).  Furthermore, conventions like this that are not clearly
articulated in an accepted "style guide" confuse newcomers to no end.

> The important thing, I guess, is that it makes sense to the author.
> Likely, Martin "understands" what JOT means and within the context of ZEN,
> it is probably appropriate.

I disagree.  I think the important thing is that it makes sense to somebody
else picking up the code for the first time.

If we want Forth to prosper, we have to get out of this mindset that Forth
is our personal playground.  When you write a program that is intended to
be studied and maintained by other people (i.e. any program with any long
term economic value), you are communicating not only with the computer,
but perhaps more importantly, with all the people who will read the program
source later on.  Many of those people will not be Forth gurus, and thus
will not know all the little quirks of the many Forth naming conventions.

Mitch Bradley

hnridder@cs.ruu.nl (Ernst de Ridder) (05/27/91)

In <9105242031.AA02014@ucbvax.Berkeley.EDU> Mitch.Bradley@ENG.SUN.COM (Mitch Bradley) writes:
>Forth programmers used to F83 might think that #BUFFER signifies the
>number of characters in the buffer, not the buffer itself (cf. #TIB ,
>#OUT , #LINE ).  Furthermore, conventions like this that are not clearly
>articulated in an accepted "style guide" confuse newcomers to no end.

>source later on.  Many of those people will not be Forth gurus, and thus
>will not know all the little quirks of the many Forth naming conventions.

What (different) naming conventions are there?

	Ernst

(Email preferred, I will summarize to the net if enough interest)
-- 
popa
iret

Qualitas qualitatem inducit.  Semper ego qualitatem.
-------------------------------------------------------------------------------
Ernst de Ridder                     (student) | Email: hnridder@cs.ruu.nl
Dept. of Computer Science, Utrecht University | Fido: Ernst de.Ridder
UUCP: !mcsun!hp4nl!ruuinf!praxis!hnridder     |       2:284/203.6
-------------------------------------------------------------------------------

-- 
popa
iret

Qualitas qualitatem inducit.  Semper ego qualitatem.