On Fri, 19 Jul 2013 09:34:41 -0400, John Gilmore wrote: > >Organizing a symbol table/dictionary by identifier length is an old >idea. For example, the Lowry-Medlock FORTRAN H compiler, to which I >have referred here before, kept one-, two-, three-, four-, five- and >six-character identifiers is separate subdictionaries. ... > This strikes me as naive technology. Beyond regarding the length as a first-level hash index, I see little value in distinguishing among 3-, 4-, 5-, and 6-character identifiers. Hashing and binary search trees probably give better results.
>There is strong evidence, derived from studies of large samples of >source programs, that single-character identifiers are both fewer and >referenced much more frequently than longer identifiers, at least in >languages in the FORTRAN-ALGOL tradition. There's a strict upper bound on the former; fairly small unless one admits Unicode. > ... This probably reflects the >contaminating influence of mathematical notation. (I have more than >once been dismayed to see that COBOL programmers, who are largely free >of this malign influence and who do not use subscripts/indices a lot, >often give them long identifiers like >'in-batch-subgroup-index-position' when they do use them.) > It's unclear which tradition you favor. Mathematical/scientific notation tends to use single-character identifiers, to be case-sensitive, and to admit characters from Greek, Hebrew, ... alphabets ("ψ*", "ℵo") (Unicode, again). (We needn't discuss APL.) I have on occasion refactored code to use longer identifiers, both for internal documentation and to facilitate string searches for them. Even in Rexx I place little value on the performance benefits of single character identifiers. (I know; modern development environments obviate the need for searching for identifiers as strings, but such tools are not uniformly available.) -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN