On Mon, 2005-04-25 at 22:24 -0500, Rod Adams wrote:

> Not exactly a fair comparison, since it's common to not "use English" 
> due to the $& issue.
> 
> I suspect that if that was not the case, it would be used more.

The reasons I don't "use English" in P5:

      * Variable access is slower
      * Names like OUTPUT_AUTOFLUSH are painful
      * I remember $', $/, $\ more easily (that's probably just from
        having written code with them for 13+ years)

Now, assuming P6 makes:

        $FUNKYNAME := $*;

efficient, then my only real concern is how much of a pain these are to
type. I'd really love to have names that are short (3-7 characters) and
yet clear enough to justify using English.

Let's look at P5 English, and see how that might look. Note that these
are all regular variables (e.g. no "$*" noise), which is because an
explicit call to "use English" would import these names to your
namespace.

P5                      P6

$ARG                    ok
$MATCH                  ok
$PREMATCH               $BEFORE
$POSTMATCH              $AFTER
$LAST_PAREN_MATCH       $LAST
@LAST_MATCH_END         @POSEND
$INPUT_LINE_NUMBER      n/a
$INPUT_RECORD_SEPARATOR n/a
$OUTPUT_AUTOFLUSH       n/a
$OUTPUT_FIELD_SEPARATOR $FIELDSEP
$OUTPUT_RECORD_SEPARATOR        $RECSEP
$LIST_SEPARATOR         $LISTSEP
$SUBSCRIPT_SEPARATOR    $SUBSEP (already an alias in P5)
$FORMAT_PAGE_NUMBER     n/a
$FORMAT_LINES_PER_PAGE  n/a
$FORMAT_LINES_LEFT      n/a
@LAST_MATCH_START       @POSSTART
$FORMAT_NAME            n/a
$FORMAT_TOP_NAME        n/a
$FORMAT_LINE_BREAK_CHARACTERS   n/a
$FORMAT_FORMFEED        n/a
$ACCUMULATOR            n/a
$CHILD_ERROR            n/a
$ERRNO                  $ERR (it's not just a number, POSIX aside)
$EXTENDED_OS_ERROR      $OSERR
$EVAL_ERROR             n/a
$PID                    good (note: might be n/a if accessed through OO)
$UID                    good
$EUID                   good
$GID                    good
$EGID                   good
$PROGRAM_NAME           $PROG
$COMPILING              n/a?
$DEBUGGING              n/a?
$SYSTEM_FD_MAX          ? (will P6 have access to this?)
$INPLACE_EDIT           ?
$OSNAME                 good (but might be in a separate module)
$PERLDB                 ?
$LAST_REGEXP_CODE_RESULT        $RULEEVAL
$EXCEPTIONS_BEING_CAUGHT        ?
$BASETIME               good
$PERL_VERSION           $PERL
$WARNING                ?
$EXECUTABLE_NAME        $PERLEXE
ARGV                    ?
$ARGV                   good, but probably ARGS
ARGVOUT                 ?
@F                      ?
@INC                    ?
@_                      alias: @PARAMS
%INC                    ?
%ENV                    good
%SIG                    good (but possibly different)

As a side note, I'd like to suggest that "English" is just rubbing
people's noses in the fact that they're not allowed to program in their
native tongue. "Names" might be less in-your-face.


Reply via email to