all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Skip Montanaro <skip.montanaro@gmail.com>
To: Krishnakant <krmane@openmailbox.org>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>,
	Yuri Khan <yuri.v.khan@gmail.com>
Subject: Re: how to highlight block end in Python-mode indentation
Date: Sun, 21 May 2017 09:16:30 -0500	[thread overview]
Message-ID: <CANc-5UxRERgn43eeoPk_vnMqTR9X1eVxyrHsy2d3Pb99zerByg@mail.gmail.com> (raw)
In-Reply-To: <f6e88307-d5a1-87f4-8ecc-1ce646a1846b@openmailbox.org>

> PEP8 just says about using space.
> It is more of a popular way of doing things rather than a highly convincing
> advantage.

You are correct that PEP8 is convention, not stricture. Still, it was
written from experience by Guido van Rossum and a few other Python
experts. Despite the fact that it is only convention,
PEP8-compatibility is often an expectation by tools such as pylint,
and by other developers who need to read code others have written.
There is a certain amount of cognitive dissonance when you read Python
code written by someone whose personal coding style is much different
than what PEP8 outlines.

There are two advantages to using spaces:

1. Indentation (assuming < 8 spaces per indent) doesn't take the start
of the line so far to the right. If you use tabs, at the third level
you've already gobbled up 24 spaces. If (like many, but not all,
people) you work in an 80-column window, you've now got only 55
columns left for the actual bit of code on that line (assuming you
only go to column 79, which is typical). That means you wrap lines
more often and extend the vertical space necessary to express the
concept embodied in that code.

2. Woe unto anyone who winds up (accidentally or otherwise) mixing
spaces and tabs.

> I personally worked with both tabs and spaces and never find any major
> problem as such.

Don't worry, that day will come.

> Just that I am myself blind and find managing tabs with screen readers more
> convenient, but I am not against using any style.
> Never the less found white-space as the default in Emacs and is ok with my
> team who needs to see the code (unlike me who depends on speech ).

I don't think the fact that you are blind came up earlier in the
discussion. My apologies if I missed it. I don't know how you read
what's on the screen, but I can certainly understand that the computer
saying "TAB" instead of "SPACE SPACE ..." would be much easier.

I would be interested in your experience (off-list is almost certainly
best in this case) in how you adapt various coding conventions
(including PEP8) to work with your blindness. For example, you
mentioned TAB vs. SPACE. What about 80-columns? Different
capitalization for different types of identifiers?

Best,

Skip Montanaro



  reply	other threads:[~2017-05-21 14:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-19 12:01 how to highlight block end in Python-mode indentation Krishnakant
2017-05-19 12:18 ` Joost Kremers
2017-05-19 12:30   ` Krishnakant
2017-05-20  6:37   ` Krishnakant
2017-05-20  8:49     ` Joost Kremers
2017-05-19 19:18 ` Tomas Nordin
2017-05-19 19:43   ` Joost Kremers
2017-05-21 11:16   ` Krishnakant
2017-05-21 11:27     ` Skip Montanaro
2017-05-21 11:38       ` Krishnakant
2017-05-21 12:04         ` Yuri Khan
2017-05-21 13:46           ` Krishnakant
2017-05-21 14:16             ` Skip Montanaro [this message]
2017-05-21 14:45             ` Yuri Khan
2017-05-21 15:58               ` Krishnakant
2017-05-21 12:40         ` Skip Montanaro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANc-5UxRERgn43eeoPk_vnMqTR9X1eVxyrHsy2d3Pb99zerByg@mail.gmail.com \
    --to=skip.montanaro@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=krmane@openmailbox.org \
    --cc=yuri.v.khan@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.