home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.edu:1597 comp.lang.fortran:3495
- Newsgroups: comp.edu,comp.lang.fortran
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!spool.mu.edu!agate!dog.ee.lbl.gov!hellgate.utah.edu!lanl!cochiti.lanl.gov!jlg
- From: jlg@cochiti.lanl.gov (Jim Giles)
- Subject: Re: Case Sensitivity (was Re: Small Language Wanted)
- Message-ID: <1992Sep9.195806.1471@newshost.lanl.gov>
- Sender: news@newshost.lanl.gov
- Organization: Los Alamos National Laboratory
- References: <DAVIS.92Aug23010605@pacific.mps.ohio-state.edu> <1992Aug25.034553.2990@linus.mitre.org> <1992Aug25.104211.1@vxdesy.desy.de> <999@engcon.marshall.ltv.com> <9SEP199210424176@seqvax.caltech.edu>
- Distribution: usa
- Date: Wed, 9 Sep 1992 19:58:06 GMT
- Lines: 33
-
- In article <9SEP199210424176@seqvax.caltech.edu>, mathog@seqvax.caltech.edu (David Mathog) writes:
- |> [...]
- |> Sure, but it's a recipe for maintenance problems should one of the 99.999%
- |> of C programmers who aren't s&c engineers ever be called upon to modify the
- |> code. That said, Fortran code with variables named I12, I21, I13, I31 (and
- |> so forth) is just about as difficult to maintain.
- |>
- |> There must be some studies on the rate at which programmers misread code as
- |> a function of variable length and format - anybody out there know the
- |> results?
-
- I have a Pascal book (at home, or I would quote it directly) which
- elegantly makes the case *against* long identifiers by arguing *for*
- them. They compare Fortran-like identifiers (say GRDSIZ and BOXSIZ)
- to Pascal identifiers (like Size_of_Grid and Size_of_Box) and conclude
- that the latter are best. Well, I disagreed (and their examples made
- the point better than mine). If two identifiers specify different
- things, their *differences* should be the emphasis of the names - not
- their similarities. Reading lots of *long* identifiers is just as
- prone to error and misunderstanding as having inadequately short ones.
-
- I think there's no doubt that restricting identifier lengths arbitrarily
- in the language design (to anything shorter than 16 or 20 anyway) is not
- conducive to well written code. But, arbitrary use of extremely long
- identifiers, just to use up the space, should not be the result. In the
- above examples, GRID_SZ and BOX_SZ are admirable - yet are not long.
- Extremely long identifiers (more than 10-16 characters, say) should
- only be necessary when you're trying to emphasize something very
- unusual or when you have very subtle distinctions between what two
- (or more) variables do.
-
- --
- J. Giles
-