• Re: Python (was Re: I did not inhale)

    From Janis Papanagnou@21:1/5 to David Brown on Thu Aug 29 02:29:55 2024
    XPost: comp.unix.programmer, comp.lang.misc

    [ NG list changed: removed shell, added editors; Fup-to set: editors ]

    On 28.08.2024 20:48, David Brown wrote:
    On 28/08/2024 19:43, Muttley@dastardlyhq.com wrote:
    On Tue, 27 Aug 2024 21:34:54 -0000 (UTC)
    Lawrence D'Oliveiro <ldo@nz.invalid> wrote:

    In Emacs, I have commands defined to adjust the indentation of the
    selected region. Surely any other decent editor would offer the same.

    Writing editor editor macros in order to work around fundamentally bad
    language design is not something a programmer should have to waste
    time on.

    I don't know about Emacs, but in most editors the way you indent a block
    of code is to select the lines, then press "Tab". Unindenting is "shift-Tab". [...]

    I also don't know about Emacs. But there's the question how "selected
    region" [LD'O] or "select the lines" [DB] is achieved. If there's only primitive editing commands available (i.e. selection by mouse, or long
    clumsy keyboard sequences) it may be irrelevant whether you indent code
    in a Python or in a "C" program. If you're using editors like Vi that
    block selection can be done with '%' and the indent with '>%' and the
    reverse indent with '<%' (without the quotes); but that works only if
    you have the syntactical elements (the braces, parenthesis, brackets)
    as definition of the program block. That won't work for a block in a
    language like Python where blocks are defined by layout (by the grade
    of indentation); then you'd have to resort to the primitive editors'
    selection features, mouse/menus or more laborious keyboard commands.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Janis Papanagnou on Thu Aug 29 01:22:18 2024
    XPost: comp.unix.programmer, comp.lang.misc

    On Thu, 29 Aug 2024 02:29:55 +0200, Janis Papanagnou wrote:

    If there's only
    primitive editing commands available (i.e. selection by mouse, or long
    clumsy keyboard sequences) it may be irrelevant whether you indent code
    in a Python or in a "C" program. If you're using editors like Vi that
    block selection can be done with '%' and the indent with '>%' and the
    reverse indent with '<%' (without the quotes); but that works only if
    you have the syntactical elements (the braces, parenthesis, brackets) as definition of the program block. That won't work for a block in a
    language like Python where blocks are defined by layout (by the grade of indentation); then you'd have to resort to the primitive editors'
    selection features, mouse/menus or more laborious keyboard commands.

    I have Emacs commands defined to jump quickly between lines with matching indentation. That lets me easily select entire statement blocks in Python.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to Lawrence D'Oliveiro on Thu Aug 29 04:30:16 2024
    XPost: comp.unix.programmer, comp.lang.misc

    On 29.08.2024 03:22, Lawrence D'Oliveiro wrote:
    On Thu, 29 Aug 2024 02:29:55 +0200, Janis Papanagnou wrote:

    If there's only
    primitive editing commands available (i.e. selection by mouse, or long
    clumsy keyboard sequences) it may be irrelevant whether you indent code
    in a Python or in a "C" program. If you're using editors like Vi that
    block selection can be done with '%' and the indent with '>%' and the
    reverse indent with '<%' (without the quotes); but that works only if
    you have the syntactical elements (the braces, parenthesis, brackets) as
    definition of the program block. That won't work for a block in a
    language like Python where blocks are defined by layout (by the grade of
    indentation); then you'd have to resort to the primitive editors'
    selection features, mouse/menus or more laborious keyboard commands.

    I have Emacs commands defined to jump quickly between lines with matching indentation. That lets me easily select entire statement blocks in Python.

    I'm sure you have. - But wasn't that the point someone made upthread:
    "Writing editor editor macros in order to work around fundamentally bad language design is not something a programmer should have to waste time
    on." [Muttley@...] - I'm just feeling lucky with brackets and Vi. YMMV.

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to Janis Papanagnou on Thu Aug 29 05:50:29 2024
    XPost: comp.unix.programmer, comp.lang.misc

    On Thu, 29 Aug 2024 04:30:16 +0200, Janis Papanagnou wrote:

    On 29.08.2024 03:22, Lawrence D'Oliveiro wrote:

    I have Emacs commands defined to jump quickly between lines with
    matching indentation. That lets me easily select entire statement
    blocks in Python.

    I'm sure you have. - But wasn't that the point someone made upthread:

    Not really, no.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)