Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #65509
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.001 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'programmer': 0.03; '"this': 0.03; 'heavily': 0.04; 'messages.': 0.05; '(b)': 0.07; 'annotations': 0.09; 'bug.': 0.09; 'dan': 0.09; 'exercising': 0.09; 'suggestions:': 0.09; 'url:github': 0.09; 'whichever': 0.09; 'cc:addr:python-list': 0.11; 'bug': 0.12; 'gui': 0.12; 'changes': 0.15; '(it': 0.16; 'bugs.': 0.16; 'display,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; "he'll": 0.16; 'highlight': 0.16; 'meanwhile,': 0.16; 'when,': 0.16; 'wrote:': 0.18; 'looked': 0.18; 'wed,': 0.18; 'trying': 0.19; '(where': 0.19; 'any,': 0.19; 'commit': 0.19; 'thu,': 0.19; 'work,': 0.20; 'feb': 0.22; 'tests': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; '(a)': 0.24; 'why.': 0.24; 'decide': 0.24; 'versions': 0.24; '(or': 0.24; 'cc:2**0': 0.24; 'equivalent': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'generally': 0.29; 'quickly': 0.29; 'wonder': 0.29; 'message- id:@mail.gmail.com': 0.30; 'went': 0.31; 'code': 0.31; 'that.': 0.31; 'origin': 0.31; 'file': 0.32; 'bugs': 0.33; 'not.': 0.33; 'noticed': 0.34; "i'd": 0.34; 'problem': 0.35; "can't": 0.35; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'doing': 0.36; "i'll": 0.36; 'should': 0.36; 'unit': 0.37; 'so,': 0.37; 'too': 0.37; 'easily': 0.37; 'branch': 0.38; 'handle': 0.38; 'whatever': 0.38; 'pm,': 0.38; 'that,': 0.38; 'recent': 0.39; 'bad': 0.39; 'changed': 0.39; 'how': 0.40; 'even': 0.60; 'future': 0.60; 'up,': 0.60; 'most': 0.60; 'helps': 0.61; 'mentioned': 0.61; "you're": 0.61; 'back': 0.62; 'show': 0.63; 'kind': 0.63; 'line,': 0.68; 'useful.': 0.68; 'therefore': 0.72; 'carefully': 0.74; 'honest': 0.78; 'fortunately,': 0.84; 'url:master': 0.84; 'attitude': 0.91; 'browsing': 0.91; 'habit': 0.91; 'to:none': 0.92; 'yourself,': 0.95; 'fight': 0.97 |
| 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:cc :content-type; bh=aWnEDiOJCfICKg4WXiPsZarRbtuGzo81FMPck+PxAWk=; b=NT04FXWfM5w+1xs8X1WFotkpW5joDItpTmMv0xgld3mXXkkjszZuJJSOBHp56yj5Ru 6vwGA5InTXMzkpkoIJPYNjR6v1IPktio+2cq4tq3pQmD3Sn8cMLXUkWRKoY86A6LBCjb us6PZNbl/UNpWVZU0OhlL9oZ6oFVzMNWye2vCT6n8dqvdmeoyuuScRPFtwGvZHRtBpZY Q5MVmQv3LzjpWpuDmM/Csch55zn6ieM6JoNIV5r3kO2xlWxoLXJ1ZXQ9/utpHZuDyHLg 2lJK7H0evAXJ0IELZ9/zh1phwpuelOi1lsdGdlZEHcDYv3xqMzrwtkmnouHTPAEBxsj4 Jl9w== |
| MIME-Version | 1.0 |
| X-Received | by 10.68.244.103 with SMTP id xf7mr8959937pbc.50.1391662034216; Wed, 05 Feb 2014 20:47:14 -0800 (PST) |
| In-Reply-To | <lcuubf$m2$1@dont-email.me> |
| References | <f63f079f-da05-4f09-ad01-4b764ef16d7f@googlegroups.com> <lcuubf$m2$1@dont-email.me> |
| Date | Thu, 6 Feb 2014 15:47:14 +1100 |
| Subject | Re: how to reduce bugs due to incorrect indentation |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| 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.6435.1391662038.18130.python-list@python.org> (permalink) |
| Lines | 60 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1391662038 news.xs4all.nl 2851 [2001:888:2000:d::a6]:41813 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:65509 |
Show key headers only | View raw
On Thu, Feb 6, 2014 at 2:08 PM, Dan Sommers <dan@tombstonezero.net> wrote: > On Wed, 05 Feb 2014 19:02:09 -0800, msustik wrote: > >> My changes were elsewhere and I did not notice the above one line >> change when I looked at the diffs before commit. I should have noticed >> it... >> >> It was rare that a was 1 and therefore the problem did not show up for >> a while. (I know I should have had tests exercising all cases...) >> >> When the bug showed up, it was kind of difficult to remember what was >> the original intent. Fortunately, looking at old versions allowed me >> to find the problem commit and the bug. >> >> Any suggestion on how to avoid this type of error in the future? > > I think you just mentioned the best suggestions: (a) have a good > collection of unit tests (where "good" means data and branch coverage), > and (b) look carefully, or have someone else look carefully, at every > commit. Yep, I'd agree with that. Additionally, a habit of small and conceptual commits helps hugely, even if you don't look at them too carefully as they go through; get familiar with 'git gui blame' or whatever the equivalent is for your system (or just browsing through 'gitk filename.py' or equiv) and you can go back in time to pin down bugs. I had to fight heavily to get my boss to understand this, because he said he _never_ went back through the repo's history; meanwhile, I was doing so frequently, and knowing exactly what code was changed, when, and why. His attitude to bugs was "don't make any, and you're a bad programmer if you do". My attitude to bugs was, and is, "be honest with yourself, you will make them, so design your systems to handle that". When your commits are small and tidy, you can often find bugs really REALLY easily just by looking at the commit that changed some particular line. With gitk, I'll often make a dummy edit to a line, then highlight the red "this line deleted" line in the uncommitted changes display, right-click, "Show origin of this line". Alternatively, 'git blame' or other annotation can work, but I generally find that annotating a whole file is overkill and trying to ask for annotations of one small section is tedious. But whichever way you do it, you should be able to VERY quickly go from "Hmm, I wonder why this is indented like this?" to "Here's the commit that made it like that", and then you can easily decide whether it was right or not. Of course, your commit messages have to be useful. I can't honestly say my own commit messages are perfect, but at least they're not like these: https://github.com/douglascrockford/JSLint/commits/master Note to future readers: That link will take you to the most recent commits on that repo. It may be (it may be!) that, by the time you look at it, he'll have changed his practice and started writing exemplary messages. If so, just page back through the history and find how it looked in 2014. :) ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
how to reduce bugs due to incorrect indentation msustik@gmail.com - 2014-02-05 19:02 -0800
Re: how to reduce bugs due to incorrect indentation Dan Sommers <dan@tombstonezero.net> - 2014-02-06 03:08 +0000
Re: how to reduce bugs due to incorrect indentation Chris Angelico <rosuav@gmail.com> - 2014-02-06 15:47 +1100
Re: how to reduce bugs due to incorrect indentation Asaf Las <roegltd@gmail.com> - 2014-02-05 21:23 -0800
Re: how to reduce bugs due to incorrect indentation Terry Reedy <tjreedy@udel.edu> - 2014-02-06 03:09 -0500
Re: how to reduce bugs due to incorrect indentation Grant Edwards <invalid@invalid.invalid> - 2014-02-06 14:49 +0000
Re: how to reduce bugs due to incorrect indentation msustik@gmail.com - 2014-02-06 10:51 -0800
Re: how to reduce bugs due to incorrect indentation Roel Schroeven <roel@roelschroeven.net> - 2014-02-06 21:29 +0100
Re: how to reduce bugs due to incorrect indentation msustik@gmail.com - 2014-02-06 17:20 -0800
Re: how to reduce bugs due to incorrect indentation Chris Angelico <rosuav@gmail.com> - 2014-02-07 12:57 +1100
Re: how to reduce bugs due to incorrect indentation Roel Schroeven <roel@roelschroeven.net> - 2014-02-07 23:08 +0100
Re: how to reduce bugs due to incorrect indentation Jurko Gospodnetić <jurko.gospodnetic@pke.hr> - 2014-02-08 12:11 +0100
Re: how to reduce bugs due to incorrect indentation Larry Martell <larry.martell@gmail.com> - 2014-02-06 15:36 -0500
Re: how to reduce bugs due to incorrect indentation Ethan Furman <ethan@stoneleaf.us> - 2014-02-06 13:32 -0800
Re: how to reduce bugs due to incorrect indentation Larry Martell <larry.martell@gmail.com> - 2014-02-06 17:09 -0500
Re: how to reduce bugs due to incorrect indentation Chris Angelico <rosuav@gmail.com> - 2014-02-07 09:30 +1100
Re: how to reduce bugs due to incorrect indentation Asaf Las <roegltd@gmail.com> - 2014-02-06 15:01 -0800
Re: how to reduce bugs due to incorrect indentation Chris Angelico <rosuav@gmail.com> - 2014-02-07 11:08 +1100
Re: how to reduce bugs due to incorrect indentation Roel Schroeven <roel@roelschroeven.net> - 2014-02-07 23:06 +0100
csiph-web