Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'argument': 0.05; 'configure': 0.05; 'insert': 0.05; 'stops': 0.07; 'key.': 0.09; 'spaces': 0.09; 'cc:addr:python-list': 0.11; 'did.': 0.16; 'encountered,': 0.16; 'set,': 0.16; 'tab': 0.16; 'tab,': 0.16; 'tabs': 0.16; 'pushed': 0.16; 'appropriate': 0.16; 'wrote:': 0.18; 'file,': 0.19; 'thu,': 0.19; 'written': 0.21; 'feb': 0.22; '>>>': 0.22; 'preferred': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'replace': 0.24; 'decide': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'source': 0.25; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'character': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'work.': 0.31; '>>>>': 0.31; 'accidentally': 0.31; 'another.': 0.31; 'indentation': 0.31; 'larry': 0.31; 'file': 0.32; 'everyone': 0.33; 'could': 0.34; 'editor': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'surely': 0.36; 'level': 0.37; 'configured': 0.38; 'mine': 0.38; 'pm,': 0.38; 'does': 0.39; 'either': 0.39; 'space': 0.40; 'users': 0.40; 'how': 0.40; 'matter': 0.61; 'first': 0.61; 'times': 0.62; 'email addr:gmail.com': 0.63; 'show': 0.63; 'pick': 0.64; 'press': 0.70; 'bitten': 0.84; "else's": 0.84; 'ethan': 0.84; 'furman': 0.84; 'rip': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=M2+n1XmQTt53HortdxkhcNDuF8DoqQpceqM5j3AXsok=; b=L3u9KcP7dv14bl0u3jFZTK67CbjUZLGD5+Xrz1wMxvX2uV89Vbpo9XAZwH2MWuspKG B+FRjOtErrPHxiqhH5DiFVd2aGgfr9n3FkTxFsfK6owWYq7dsasdXvSewAxjp69Shgbp w3RJ0d7xWpTHgpLQ+FI9S+ZLJlbwEprD+PCOs5BuNrYeVomOJrcAo/8x9qLPYpnXzCRY 0QXA3BqOAGg+2ntHDo4h/aReCG7Z+ER2AX7zuaffJIVlDRcnsG0fLBqZlWmm7srVyJoD yZuwTYJrV1YK8T7WU5a6bBHmpqcdWKEEw1egkdBQ95GGeu12ErFRL+Pmb7edVWff3IF7 pIGQ== MIME-Version: 1.0 X-Received: by 10.140.26.43 with SMTP id 40mr15222053qgu.86.1391724584050; Thu, 06 Feb 2014 14:09:44 -0800 (PST) In-Reply-To: <52F3FF51.3050502@stoneleaf.us> References: <52F3FF51.3050502@stoneleaf.us> Date: Thu, 6 Feb 2014 17:09:43 -0500 Subject: Re: how to reduce bugs due to incorrect indentation From: Larry Martell To: Ethan Furman Content-Type: text/plain; charset=UTF-8 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1391724621 news.xs4all.nl 2945 [2001:888:2000:d::a6]:44775 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:65561 On Thu, Feb 6, 2014 at 4:32 PM, Ethan Furman wrote: > On 02/06/2014 12:36 PM, Larry Martell wrote: >> >> On Thu, Feb 6, 2014 at 3:29 PM, Roel Schroeven wrote: >>> >>> msustik@gmail.com schreef: >>>> >>>> >>>> While editing this file I accidentally pushed TAB on the line with 'y = >>>> z >>>> + y'. >>> >>> >>> My suggestion: configure your editor to insert the appropriate amount of >>> spaces instead of a tab when you press the tab key. >> >> >> +1 - tabs are evil. > > > Tabs are not evil, and an argument can be made that tabs are better (a > decent editor can be configured to show x many spaces per tab, then users > could decide how much indentation they preferred to see... but I digress). > > Using spaces instead of tabs would also have not prevented the error that > Msustik encountered, and for that matter we don't know whether he was using > tabs or spaces in his source file, only that he hit the Tab key -- surely > you are not suggesting everyone rip out their tab key and just hit the space > bar four times for each level of indentation? ;) The Tab key is not evil, it's the tab character (Ctrl-I). I have been bitten by this many time when I had to work on a program written by another. They had their tab stops set at 5 or 6, mine is set at 4, or they did not have expandtab set, but I did. So you get either a script that looks misaligned, but works, or one that does not look misaligned but doesn't work. When I have to pick up someone else's script the first thing I do is replace the tabs with spaces.