Long names are doom ?

Rainy sill at optonline.net
Sun May 27 01:10:56 EDT 2001


On Sat, 26 May 2001 08:02:05 -0700, John Roth <johnroth at ameritech.net> wrote:


> 
> Current language design separates parsing and lexing. That is, there is a
> separate
> component that is responsible for breaking the input up into logical parts,
> or
> words. The problem is cleanly separating keywords from names, since there's
> nothing (like a special character) to distinguish them. If you can't do it
> cleanly,
> the problem becomes non-deterministic, which kills your compile time and
> opens you up to very hard to understand syntax errors.
> 
> Fortran managed to do it because it has a very strict pattern where it is
> (or was)
> impossible to have a legal statement with two adjacent names. They had to be
> separated by an operator or some kind of special character, or the program
> simply wasn't legal Fortran. The exception was the keyword at the front of
> the
> statement. I can remember any number of programs that contained ten-liners:
> single statements that occupied ten lines with no spaces for readability,
> and with
> line breaks in the middle of names.
> 
> Also, I don't consider names with spaces very readable either. My personal
> preferance is to keep them as short as possible, consistent with clarity.
> Clarity
> takes a nosedive when you have to break a statement across multiple lines
> because someone decided that very long names were somehow "better
> documentation"
> than short, well chosen names.
> 
> A cursory look at one of the Python books shows these lines:
> 
> for dict in dictlist:
> if not keylist:
> 
> I would think that reserved function words like "in" "not" "and" or "or"
> would
> be rather natural parts of names.
> 
> John H. Roth Jr.

Thanks alot - that's the answer I was looking for :-).
I suspected that it's to make it easy for compiler to split
the program.. I'm not sure spaces in var names would be more readable,
either, I'd have to see a decent sized program to be sure. 

-- 
I'll give you anything, everything if you want things
        - Syd



More information about the Python-list mailing list