[Israel.pm] Completion and editors (offtopic)
migo at homemail.com
Tue Jun 8 09:26:17 PDT 2004
Yuval, I don't think you may convince me auto-completion is any good.
Really, it is slow (type, resolve conflicts), inconvenient (find your
choice in the long list of all global and local variables), helpless
(you can't see the variable description, or the code it is used in) and
distracts from actual coding. It is very editor dependent. If the editor
(I guess ctags is used here) fails to parse the Perl code, you are
screwed, because you forgot to think on your own, you are the editor
slave now. Joking.
Shell completion is good, since shell commands are static and context
based. Programming is an art, auto-completion of the code does not make
sense to me.
It is wrong that emacs and vim parse Perl correctly. At least in the
versions I have installed, emacs does not even colorize /regexp/, and it
screws /reg"exp/ completely (the rest of the file is randomly colorized).
vim does not handle s at regexp@replace@ and many other cases. And even if
these cases are fixed in the latest versions, I may always find the code
to fail. Usually my code is always incorrectly colorized, probably
because I don't use these editors and never test how they display it.
I think many people perform a lot of irrelevant workarounds to make
their editors happy. "Smart" editors are almost always a bad idea.
You are wrong that my editor supports auto-completion, it did not even
support colorizing up until now, and I didn't miss it at all. I use the
customized joe editor, it is not graphical and not smart, it just does
everything I want in a moment.
As for having to find the place where the variable is declared or used in
order to copy it. Yes, I find this a very good practice if you actually
want to ensure you use the correct variable/function. It is like browsing
the man page before using something. This task can't be automated. It
takes me about 5 seconds to find the relevant code. Sometimes I do this
by escaping to shell (Ctrl-Z) and running grep or another temporary joe.
Here file completion is a must, unlike variable completion.
I think I know why you may not like copy/paste. It is pretty inconvenient
in most of the graphical editors, because they move the cursor when you
copy a text, at least by default. It is much more convenient in pure
xterm. Start a non graphical emacs with $DISPLAY unset to see what I am
speaking about. The whole copy/paste in xterm is just "copy anywhere
(does not move the cursor)", "press middle mouse to paste". Sometimes the
thing to copy is in the previous page, so you may want to press PgDn/PgUp
before and after copying. Here emacs and vim fail completely again, PgDn
+ PgUp do not restore the original cursor position as expected, and there
is no option to do it right (in vim you may use virtualedit, but this is
not a solution).
Ok, let's stop here otherwise I will suggest to disable auto-indentation
in your editor completely just because it never works correctly. :)
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'
More information about the Perl