Variable Naming [was Re: [Israel.pm] catching $a, $b unnecessary my and maybe other things]
migo at homemail.com
Mon Jun 7 05:58:59 PDT 2004
On 07 Jun 2004 09:19:47 +0300, Yuval Yaari wrote:
> Also, long names should be auto-completed, or else you're using the wrong
This is starting to be a non-constructive discussion, but maybe you want
to hear an alternative opinion.
I would not use the auto-completion of variables and functions even if
someone implemented it in my editor of choice. Seems so much error-prone.
When I see a dozen of unrelated (or related) variable names as completion
choices, the first thing I want is to see the context they are used in,
so I would need to review a lot of unrelevant code just to determine the
correct variable to insert. Such way of working seems more confusing to
me than helpful and one should still type to resolve conflicts. I would
rather just find the relevant context manually and copy/paste the correct
variable to avoid any kind of typos. Since most of variables are local,
they are usually visible, so, again, the auto-completion is not needed.
In general, the smarter is the editor the less people want to think.
While an editor may help to search quicker, to present nicier (both
issues are subjective as well), I don't think choosing the correct
variable to insert in any particular place is such automatical task.
> Not getting into editor wars, but this is so basic, I guess even
> notepad.exe should have this feature.
I doubt there is an editor that even colorizes (or otherwise parses) Perl
code correctly in all non-trivial cases.
> I don't copy paste, I always auto-complete, and it works well.
Just wait for a large project with a lot of variables/functions to see
how inconvenient this feature is. Anyway, I am glad you use it, I am
less glad you call editor "wrong" based on something questionable. :)
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'
More information about the Perl