Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #82121

Re: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <prvs=412f4c609=jeanmichel@sequans.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.185
X-Spam-Level *
X-Spam-Evidence '*H*': 0.63; '*S*': 0.00; '(instead': 0.09; 'editor.': 0.09; 'width': 0.09; 'developer': 0.10; 'cc:addr :python-list': 0.11; 'limit.': 0.16; 'monitors': 0.16; 'readability': 0.16; 'reason.': 0.16; 'subject: \n ': 0.16; 'subject:Line': 0.16; 'tab': 0.16; 'tabs': 0.16; 'width,': 0.16; 'code.': 0.18; 'cc:addr:python.org': 0.22; '(by': 0.24; 'char': 0.24; 'instance,': 0.24; 'merge': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'define': 0.26; 'header:In-Reply-To:1': 0.27; 'characters': 0.30; 'code': 0.31; 'breaking': 0.31; 'indentation': 0.31; "they'll": 0.31; 'extend': 0.32; 'maintaining': 0.32; 'themselves': 0.32; '-----': 0.33; 'monday,': 0.33; 'could': 0.34; 'display': 0.35; 'problem.': 0.35; 'editor': 0.35; 'but': 0.35; 'leads': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'should': 0.36; 'email addr:python.org': 0.37; 'easily': 0.37; 'thank': 0.38; 'e.g.': 0.38; 'files': 0.38; 'issue': 0.38; 'subject:': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'most': 0.60; 'length': 0.61; 'browser': 0.61; 'simply': 0.61; 'simple': 0.61; 'you.': 0.62; 'information': 0.63; 'developed': 0.63; 'maximum': 0.63; 'received:194': 0.64; 'different': 0.65; 'email name:python-list': 0.65; 'talking': 0.65; 'notice:': 0.67; 'person,': 0.68; 'privileged.': 0.69; 'limit': 0.70; 'disclose': 0.74; '100': 0.79; '160': 0.84; 'december,': 0.84; 'exceeding': 0.84; 'flame': 0.84; 'subject:Using': 0.84; 'medium.': 0.91; 'choice.': 0.93; 'realistic': 0.93
X-IronPort-AV E=Sophos;i="5.07,538,1413237600"; d="scan'208";a="3700216"
Date Mon, 8 Dec 2014 14:07:36 +0100 (CET)
From Jean-Michel Pichavant <jeanmichel@sequans.com>
To Aahan Krish <krish@aahan.me>
In-Reply-To <CAFaCOgxq6jp5bDXcKvXztAXdwxTOBoYRmEf2v4g_1nAYwJutGw@mail.gmail.com>
Subject Re: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?
MIME-Version 1.0
X-Mailer Zimbra 7.2.7_GA_2942 (ZimbraWebClient - GC37 (Linux)/7.2.7_GA_2942)
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.16720.1418044064.18130.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1418044064 news.xs4all.nl 2917 [2001:888:2000:d::a6]:50541
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:82121

Show key headers only | View raw


----- Original Message -----
> From: "Aahan Krish" <krish@aahan.me>
> To: python-list@python.org
> Sent: Monday, 8 December, 2014 3:15:43 AM
> Subject: Maintaining Maximum Line Length When Using Tabs Instead of Spaces?
> 
> My understanding from talking to different people is that many do use
> tabs (instead of spaces) for indentation in their code.
> 
> My question is to them (because I want to use tabs too) is: how do
> you
> maintain a line-length of 79 characters?
> 
> E.g. scenario: The tab setting in your editor could be 2 or 4, and in
> other developer's browser it could be 8. The code will be longer than
> 79 chars in the latter's editor.
> 
> I want to know if it's at all possible or if you use some simple and
> realistic (practical) hacks.
> 
> *PS: Please avoid, "That's why you should use spaces," type of
> comments. I would like to avoid flame wars.*
> 
> TY,
> Aahan

You simply need to define the standard width for you tab display. 4 is very common.

Those in your team who want to use a different display (3 flowers for instance) can, but they'll have to deal with the 79 limit by themselves which can be tricky.
Note that the 79 limit is a legacy value from the time where code was developed in 80 characters terminals with names not exceeding 8 characters (by convention).

Given the number of monitors you have and their width, you may extend this limit. For instance, I can easily make a 3 files merge with 160 chars per line without problem.
Considering the current state of most developer hardware, a limit around 100 char per line is most of the time a better choice.

Remember that breaking a line of 81 characters often leads to readability issue for no (modern) reason.


JM






-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Maintaining Maximum Line Length When Using Tabs Instead of Spaces? Jean-Michel Pichavant <jeanmichel@sequans.com> - 2014-12-08 14:07 +0100

csiph-web