Re: What text editor is everyone using for Python

Discussion in 'Python' started by Lawrence D'Oliveiro, May 26, 2009.

  1. In message <d6d05d39-98e7-4c28-
    >, LittleGrasshopper wrote:

    > ... I am looking for suitable syntax files for [editor of choice] ...


    I don't understand why people need "syntax files" to use a text editor.
     
    Lawrence D'Oliveiro, May 26, 2009
    #1
    1. Advertising

  2. On Tue, 26 May 2009 18:31:56 +1200, Lawrence D'Oliveiro wrote:

    > In message <d6d05d39-98e7-4c28-
    > >, LittleGrasshopper
    > wrote:
    >
    >> ... I am looking for suitable syntax files for [editor of choice] ...

    >
    > I don't understand why people need "syntax files" to use a text editor.


    Do you want syntax highlighting?

    If so, then your editor needs to either have an external config file
    describing the syntax you want highlighted, or a built-in internal config
    to do the same thing. For various reasons, it's better to have such
    config as an external file rather than compiled into the editor.

    If you've never used syntax highlighting, then you don't know what you're
    missing. I can do without it, but it's a bother.



    --
    Steven
     
    Steven D'Aprano, May 26, 2009
    #2
    1. Advertising

  3. In message <>, Steven
    D'Aprano wrote:

    > On Tue, 26 May 2009 18:31:56 +1200, Lawrence D'Oliveiro wrote:
    >
    >> In message <d6d05d39-98e7-4c28-
    >> >, LittleGrasshopper
    >> wrote:
    >>
    >>> ... I am looking for suitable syntax files for [editor of choice] ...

    >>
    >> I don't understand why people need "syntax files" to use a text editor.

    >
    > Do you want syntax highlighting?


    Why?
     
    Lawrence D'Oliveiro, May 26, 2009
    #3
  4. Lawrence D'Oliveiro

    CTO Guest

    On May 26, 3:23 am, Lawrence D'Oliveiro <l...@geek-
    central.gen.new_zealand> wrote:
    > In message <>, Steven
    >
    > D'Aprano wrote:
    > > On Tue, 26 May 2009 18:31:56 +1200, Lawrence D'Oliveiro wrote:

    >
    > >> In message <d6d05d39-98e7-4c28-
    > >> >, LittleGrasshopper
    > >> wrote:

    >
    > >>> ... I am looking for suitable syntax files for [editor of choice] ...

    >
    > >> I don't understand why people need "syntax files" to use a text editor..

    >
    > > Do you want syntax highlighting?

    >
    > Why?


    Provides a clear visual indicator of when you've screwed up, which is
    pretty important for me ;)

    Geremy Condra
     
    CTO, May 26, 2009
    #4
  5. "Lawrence D'Oliveiro" <ldo@geek....new_zealand> wrote:

    > In message <>, Steven
    > D'Aprano wrote:
    >
    > > On Tue, 26 May 2009 18:31:56 +1200, Lawrence D'Oliveiro wrote:
    > >
    > >> In message <d6d05d39-98e7-4c28-
    > >> >, LittleGrasshopper
    > >> wrote:
    > >>
    > >>> ... I am looking for suitable syntax files for [editor of choice] ...
    > >>
    > >> I don't understand why people need "syntax files" to use a text editor.

    > >
    > > Do you want syntax highlighting?

    >
    > Why?


    It makes your screen look more busy as you type - for instance, if you
    type a " or a ' then it treats the rest of the file from that point on as
    belonging to the same string you are about to start typing, and colours it
    all using the colour you have selected for displaying string literals.
    This is basically to make you seasick and to force you to type the closing
    quote immediately and then to back arrow to inside the string again to finish
    typing the string, thereby making sure that firstly you type more keystrokes,
    which will look good on your productivity summary, and secondly to save the
    Python parser the hassle of dealing with a string that has no end quote.

    Now with a recommendation like that - how can you possibly refuse to use
    this excellent technology - are you some kind of Luddite, or what?

    :) - Hendrik
     
    Hendrik van Rooyen, May 26, 2009
    #5
  6. On Tue, 26 May 2009 19:23:19 +1200, Lawrence D'Oliveiro wrote:

    > In message <>,
    > Steven D'Aprano wrote:
    >
    >> On Tue, 26 May 2009 18:31:56 +1200, Lawrence D'Oliveiro wrote:
    >>
    >>> In message <d6d05d39-98e7-4c28-
    >>> >, LittleGrasshopper
    >>> wrote:
    >>>
    >>>> ... I am looking for suitable syntax files for [editor of choice] ...
    >>>
    >>> I don't understand why people need "syntax files" to use a text
    >>> editor.

    >>
    >> Do you want syntax highlighting?

    >
    > Why?


    The human visual system is evolved to detect, and respond to, differences
    in the frequency of light entering the eye. This is called "colour", and
    colour can be used to make certain things stand out more than others, or
    fade more into the background. *wink*

    The use of colour not only increases the bandwidth of information
    entering the brain, but it can be used to discriminate between what's
    important and what isn't. Personally, I find that it is worth having
    syntax highlighting just to get comments displayed in grey instead of
    black. Everything else is a bonus: e.g. I can instantly tell if I
    neglected to close a string, because my code displays in red.



    --
    Steven
     
    Steven D'Aprano, May 26, 2009
    #6
  7. Lawrence D'Oliveiro

    Paul Rudin Guest

    Steven D'Aprano <> writes:

    > e.g. I can instantly tell if I neglected to close a string, because
    > my code displays in red.


    I like syntax hightlighting for whitespace related things in python. e.g
    to highlight tabs, or whitespace at the end of a line.
     
    Paul Rudin, May 26, 2009
    #7
  8. In message <>, Hendrik van
    Rooyen wrote:

    > "Lawrence D'Oliveiro" <ldo@geek....new_zealand> wrote:
    >>
    >> Why [do you want syntax highlighting]?

    >
    > It makes your screen look more busy as you type - for instance, if you
    > type a " or a ' then it treats the rest of the file from that point on as
    > belonging to the same string you are about to start typing, and colours it
    > all using the colour you have selected for displaying string literals.
    > This is basically to make you seasick and to force you to type the closing
    > quote immediately and then to back arrow to inside the string again to
    > finish typing the string, thereby making sure that firstly you type more
    > keystrokes, which will look good on your productivity summary, and
    > secondly to save the Python parser the hassle of dealing with a string
    > that has no end quote.


    Yeah, that's about what I figured. I think I first came across it 15 years
    ago in Metrowerks CodeWarrior. I tried it for a while, but it didn't really
    help with any of my program bugs, so I turned it off.
     
    Lawrence D'Oliveiro, May 26, 2009
    #8
  9. Lawrence D'Oliveiro

    Roy Smith Guest

    In article <>,
    "Hendrik van Rooyen" <> wrote:

    > [syntax coloring] makes your screen look more busy as you type - for instance, if you
    > type a " or a ' then it treats the rest of the file from that point on as
    > belonging to the same string you are about to start typing, and colours it
    > all using the colour you have selected for displaying string literals.
    > This is basically to make you seasick and to force you to type the closing
    > quote immediately


    Good syntax coloring implementations have some hysteresis built in, to
    prevent transient things (like strings you haven't closed yet) from
    changing the entire file. If you stop typing for a while, it then does a
    full update. This avoids the problem above.

    That being said, syntax coloring is like any other tool. It's worth
    trying, but if you find it hinders you more than it helps, turn it off.
    Different strokes for different folks.

    My pet peeve is syntax-aware editors which get things wrong. For example,
    the version of emacs I'm using now doesn't parse this properly:

    '''A triple-quoted string. Some editors won't get this right'''

    The solution is to change the outer quotes to double-quotes, but it annoys
    me when I have to change my code to appease a tool.
     
    Roy Smith, May 26, 2009
    #9
  10. Lawrence D'Oliveiro <_zealand> writes:

    > In message <>, Hendrik van
    > Rooyen wrote:
    >
    >> "Lawrence D'Oliveiro" <ldo@geek....new_zealand> wrote:
    >>>
    >>> Why [do you want syntax highlighting]?

    >>
    >> It makes your screen look more busy as you type - for instance, if you
    >> type a " or a ' then it treats the rest of the file from that point on as
    >> belonging to the same string you are about to start typing, and colours it
    >> all using the colour you have selected for displaying string literals.
    >> This is basically to make you seasick and to force you to type the closing
    >> quote immediately and then to back arrow to inside the string again to
    >> finish typing the string, thereby making sure that firstly you type more
    >> keystrokes, which will look good on your productivity summary, and
    >> secondly to save the Python parser the hassle of dealing with a string
    >> that has no end quote.

    >
    > Yeah, that's about what I figured. I think I first came across it 15 years
    > ago in Metrowerks CodeWarrior. I tried it for a while, but it didn't really
    > help with any of my program bugs, so I turned it off.


    It's a bit like the colour-coding of electrical cables - distracting
    more than anything else! And don't start me on traffic lights... They
    nearly give me an epileptic fit each time.

    That's why I use ed. Ed is the standard text editor [1]. Ed is open
    source [2].

    [1] http://www.gnu.org/fun/jokes/ed.msg
    [2] http://www.gnu.org/fun/jokes/ed

    --
    Arnaud
     
    Arnaud Delobelle, May 26, 2009
    #10
  11. Lawrence D'Oliveiro

    Roy Smith Guest

    In article <>,
    Arnaud Delobelle <> wrote:

    > That's why I use ed. Ed is the standard text editor [1]. Ed is open
    > source [2].


    I still use ed sometimes. If I'm on a box which doesn't have emacs
    installed (or using something whose terminal emulation is totally broken),
    it lets me get work done.
     
    Roy Smith, May 27, 2009
    #11
  12. Lawrence D'Oliveiro

    Rhodri James Guest

    On Tue, 26 May 2009 14:22:29 +0100, Roy Smith <> wrote:

    > My pet peeve is syntax-aware editors which get things wrong. For
    > example,
    > the version of emacs I'm using now doesn't parse this properly:
    >
    > '''A triple-quoted string. Some editors won't get this right'''
    >
    > The solution is to change the outer quotes to double-quotes, but it
    > annoys me when I have to change my code to appease a tool.


    It's the separate python-mode that gets this (and much else) wrong.
    The Python mode that Ubuntu packages with emacs 22.2.1 works just
    fine.

    --
    Rhodri James *-* Wildebeeste Herder to the Masses
     
    Rhodri James, May 27, 2009
    #12
  13. Lawrence D'Oliveiro

    Roy Smith Guest

    In article <>,
    "Rhodri James" <> wrote:

    > On Tue, 26 May 2009 14:22:29 +0100, Roy Smith <> wrote:
    >
    > > My pet peeve is syntax-aware editors which get things wrong. For
    > > example,
    > > the version of emacs I'm using now doesn't parse this properly:
    > >
    > > '''A triple-quoted string. Some editors won't get this right'''
    > >
    > > The solution is to change the outer quotes to double-quotes, but it
    > > annoys me when I have to change my code to appease a tool.

    >
    > It's the separate python-mode that gets this (and much else) wrong.
    > The Python mode that Ubuntu packages with emacs 22.2.1 works just
    > fine.


    Cool. I'll see if I can snarf that and use it instead.
     
    Roy Smith, May 27, 2009
    #13
  14. In message <>, Arnaud Delobelle wrote:

    > That's why I use ed.


    After 20 years of suffering with vi, I finally decided to switch to Emacs.
    Yes, it has lots of fancy features and "modes" and things, but it wasn't
    hard to figure out how to turn the intrusive stuff off, and still leave a
    very powerful and useful editor.
     
    Lawrence D'Oliveiro, May 27, 2009
    #14
  15. Rhodri James a écrit :
    > On Tue, 26 May 2009 14:22:29 +0100, Roy Smith <> wrote:
    >
    >> My pet peeve is syntax-aware editors which get things wrong. For
    >> example,
    >> the version of emacs I'm using now doesn't parse this properly:
    >>
    >> '''A triple-quoted string. Some editors won't get this right'''
    >>
    >> The solution is to change the outer quotes to double-quotes, but it
    >> annoys me when I have to change my code to appease a tool.

    >
    > It's the separate python-mode that gets this (and much else) wrong.
    > The Python mode that Ubuntu packages with emacs 22.2.1 works just
    > fine.


    On this point, indeed. But it also lacks almost every nice feature of
    the One True python-mode (or at least did last time I had to update this
    .... ubuntu box at work).
     
    Bruno Desthuilliers, May 27, 2009
    #15
  16. Lawrence D'Oliveiro

    Rhodri James Guest

    On Wed, 27 May 2009 16:56:12 +0100, Bruno Desthuilliers
    <> wrote:

    > Rhodri James a écrit :
    >> On Tue, 26 May 2009 14:22:29 +0100, Roy Smith <> wrote:
    >>
    >>> My pet peeve is syntax-aware editors which get things wrong. For
    >>> example,
    >>> the version of emacs I'm using now doesn't parse this properly:
    >>>
    >>> '''A triple-quoted string. Some editors won't get this right'''
    >>>
    >>> The solution is to change the outer quotes to double-quotes, but it
    >>> annoys me when I have to change my code to appease a tool.

    >> It's the separate python-mode that gets this (and much else) wrong.
    >> The Python mode that Ubuntu packages with emacs 22.2.1 works just
    >> fine.

    >
    > On this point, indeed. But it also lacks almost every nice feature of
    > the One True python-mode (or at least did last time I had to update this
    > ... ubuntu box at work).


    That rather depends on your definition of "nice". The only feature of
    python-mode.el that I miss in python.el is the ability to run pylint from
    the menu, and I'll get over that. The feature that caused me to uninstall
    python-mode.el was its bloody-minded determination to regard '_' as a word
    character, something which caused me more typing that it ever saved.

    --
    Rhodri James *-* Wildebeeste Herder to the Masses
     
    Rhodri James, May 27, 2009
    #16
  17. Lawrence D'Oliveiro

    Paul Rudin Guest

    "Rhodri James" <> writes:

    > The feature that caused me to uninstall python-mode.el was its
    > bloody-minded determination to regard '_' as a word character,
    > something which caused me more typing that it ever saved.


    Probably you could have changed this in a few minutes. Or does fiddling
    with emacs lisp invalidate your python programmer's licence? ;-)
     
    Paul Rudin, May 28, 2009
    #17
  18. Lawrence D'Oliveiro

    Rhodri James Guest

    On Thu, 28 May 2009 06:24:56 +0100, Paul Rudin <>
    wrote:

    > "Rhodri James" <> writes:
    >
    >> The feature that caused me to uninstall python-mode.el was its
    >> bloody-minded determination to regard '_' as a word character,
    >> something which caused me more typing that it ever saved.

    >
    > Probably you could have changed this in a few minutes. Or does fiddling
    > with emacs lisp invalidate your python programmer's licence? ;-)


    I probably could, but uninstalling didn't even require that much
    brain-power, and as I said I only missed one feature (and that not
    much).

    --
    Rhodri James *-* Wildebeeste Herder to the Masses
     
    Rhodri James, May 28, 2009
    #18
  19. Lawrence D'Oliveiro

    Aahz Guest

    Syntax highlighting, round 42 (was Re: What text editor is everyone using for Python)

    In article <gvg5d7$382$>,
    Lawrence D'Oliveiro <_zealand> wrote:
    >In message <>, Steven
    >D'Aprano wrote:
    >> On Tue, 26 May 2009 18:31:56 +1200, Lawrence D'Oliveiro wrote:
    >>> In message <d6d05d39-98e7-4c28-
    >>> >, LittleGrasshopper
    >>> wrote:
    >>>>
    >>>> ... I am looking for suitable syntax files for [editor of choice] ...
    >>>
    >>> I don't understand why people need "syntax files" to use a text editor.

    >>
    >> Do you want syntax highlighting?

    >
    >Why?


    Didn't we have this discussion just a few weeks ago, when I said that
    highlighting made my eyes bleed? [....] Oh, Gooja sez that we did it at
    the beginning of February, so almost four months.
    --
    Aahz () <*> http://www.pythoncraft.com/

    my-python-code-runs-5x-faster-this-month-thanks-to-dumping-$2K-
    on-a-new-machine-ly y'rs - tim
     
    Aahz, May 29, 2009
    #19
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stylus Studio
    Replies:
    0
    Views:
    687
    Stylus Studio
    Aug 3, 2004
  2. Matt McCredie
    Replies:
    6
    Views:
    383
    Fuzzyman
    Sep 20, 2007
  3. J Kenneth King
    Replies:
    41
    Views:
    896
    JussiJ
    Jun 18, 2009
  4. Steven D'Aprano
    Replies:
    4
    Views:
    899
  5. Mel
    Replies:
    17
    Views:
    418
    Lawrence D'Oliveiro
    May 29, 2009
Loading...

Share This Page