end of print = lower productivity ?

Lie Lie.1296 at gmail.com
Sat Nov 29 22:13:44 CET 2008


On Nov 25, 11:44 pm, Tim Chase <python.l... at tim.thechases.com> wrote:
> >>>>> p = print
> >>>>> p("f")
> >> Voila, 4 keystrokes saved :-)
>
> > When I write "print", it is both effortless and instantaneous : my
> > hands do not move, a wave goes through my fingers, it all happens in a
> > tenth of a second.
>
> > Contrast this with what one has to go through to catch the SHIFT key,
> > and then the "(" : move the left hand, press SHIFT, move the right
> > hand, aim "(", press, miss, press again. Same thing at the end of the
> > function call.
>
> > I know it sounds ridiculous, but it does *impair* my debugging
> > productivity. Taylor would agree.
>
> It's not so much "rediculous" as a failure of your editor to
> assist you.  In Vim (my editor-of-choice), I'd do something like
>
>    :iab print print()<left><bs>

seriously, I don't think anyone in Windows uses vim and there are
quite a lot of Windows Python user. Since when is python becoming
exclusive community for Linux/Unix-like/Cygwin users that Windows
users who have nothing but Notepad is put aside.

Python has long "advertised" itself as a language that is better off
without an IDE, i.e. encourages plain text editor over IDE. By
introducing print-as-function, doing a simple print does requires you
to use more shift-key than before, but having to configure your text
editor to substitute print to print() is just as nice and disgusting
as using an IDE, I, for instance, hates when my text editors tries to
be smarter than me. A practical example is Scribes Text Editor, which
"features" auto-pair completion, which drives me mad for it trying to
close tags where I only want open tags. I never used that "smart"
editor again ever since (even if I know I can turn that off easily).

> and that's the end of it.  Or you could be even lazier if you
> don't name your variables "p":
>
>    :iab p print()<left>
>
> in which case you can just type
>
>    p"
>
> and it automatically populates with
>
>    print(")
>
> with the cursor after the double-quote ready for you to type the
> string's contents.  Net gain:  5 characters in old-Python and 6
> characters in new-Python ;-)

Is that supposed to be a joke?

> Any editor environment worth its salt should allow you to do
> things like this (insert abreviated text or template text).  The
> gains made from making "print" a function far outweigh niggling
> things that simple editor-tweaks can overcome.
>
> -tkc

In general, I don't hate the print-as-function for having to type open
and closing parens. I am, in fact, indifferent to that change. But
I've got to say that I HATE "smart-ass" (read: less than stupid)
editors. I'm sure when my dislike for "smart" editors is coupled with
someone's else's hate for print-as-function, s/he would consider end
of print-as-statement as lowering productivity.



More information about the Python-list mailing list