in reply to Re: Common Words, Perl Keywords
in thread Common Words, Perl Keywords

Perl tends to follow principles of natural languages closer than most computer languages

Closer than what? SML? Perl's constantly held up as being "closer to natural languages" but compared to what? C? When you make a fair comparison, like Ruby or Python (or even Java) that simply does not hold up. You can write code in Python that reads as concise sentences and doesn't look like \$@%<>{}; are all now letters of the alphabet.

As for number of words 25 of those are python keywords. This is a much higher percentage of keywords than Perl. This is also completely irrelevant as being one of those words does not make the language easier to use. Def, del, exec are all good keywords but won't be found on that list. If you're going to look at how close a programming language is to a human language, you'd be better off focusing on the actual instruction statements rather than numbers of keywords on some list.

Replies are listed 'Best First'.
Re: Re: Re: Common Words, Perl Keywords
by hardburn (Abbot) on Nov 26, 2003 at 14:47 UTC

    The movement towards making programming languages as close to English as possible was a big failure (see also: COBOL, FORTRAN). However, following the principles of natural languages doesn't necessarily mean you have a lot of English-like words in your syntax (or French-like, or German-like, or whatever). Rather, it means code is structured in a similar way.

    For instance, you might say "Release the sheep, unless it's raining". Wheras in Perl you could say $sheep->release unless is_raining();. Another example is the use of a pronoun: $_. How many times do you say 'it' in normal English speech? A bloody lot of times. $_ is used similarly.

    This isn't to say that other programming languages don't have some aspects of natural language in them. The difference is that natural language is all but an explicit design goal in Perl.

    ----
    I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
    -- Schemer

    : () { :|:& };:

    Note: All code is untested, unless otherwise stated

Re: Re: Re: Common Words, Perl Keywords
by guha (Priest) on Nov 26, 2003 at 10:01 UTC
    comparison, like Ruby or Python (or even Java) that simply does not hold up. You can write code in Python that reads as concise sentences and doesn't look like \$@%<>{}; are all now letters of the alphabet.

    If the 1000 words list had contained the common swearing and cursing in spoken english , regexes and perlvar might have given Perl better percentage ;-)