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


Groups > comp.lang.python > #62515

Re: Why Python is like C++

From Terry Reedy <tjreedy@udel.edu>
Subject Re: Why Python is like C++
Date 2013-12-21 17:03 -0500
References <roy-666C26.09193920122013@news.panix.com> <l9399l$dg0$1@ger.gmane.org> <mailman.4462.1387614224.18130.python-list@python.org> <roy-246789.10104821122013@news.panix.com>
Newsgroups comp.lang.python
Message-ID <mailman.4486.1387663424.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 12/21/2013 10:10 AM, Roy Smith wrote:

> On the last large C++ project I worked on, we decided (i.e. obeyed a
> corporate mandate) to start using Coverity's static analysis tool on our
> 15 year old codebase.  I learned a few things about static analysis then.

CPython was about that old when Coverity started giving us reports on 
the C part of CPython (about 400000 loc). CPython is now essentially 
free of errors detected by Coverity.

> 1) It finds bugs you would never find yourself.

Coverity apparently found several for CPython.

> 2) If your code does tricky things, you can fool the static analyzer,
> leading to false positives.

One can define code patterns that are false positives, to silence such 
reports.

>  Presumably, it also leads to false
> negatives, but you don't know about those :-(

We use unit tests to find logic bugs ;-).

> 3) If you're going to use static analysis, probably the best way is to
> start using it from day one.  Trying to duct-tape a static analysis step
> into your development process for a legacy codebase is probably more
> effort than it's worth.

Some of the C coders on the development team thought it *was* for 
CPython. The fact that CPython has been compiled for, say, 20 different 
systems may have meant that it already depended less on 
'implementation-defined' behavior.

-- 
Terry Jan Reedy

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


Thread

Why Python is like C++ Roy Smith <roy@panix.com> - 2013-12-20 09:19 -0500
  Re: Why Python is like C++ Serhiy Storchaka <storchaka@gmail.com> - 2013-12-20 19:46 +0200
    Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-21 10:44 +1300
      Re: Why Python is like C++ Michael Torrie <torriem@gmail.com> - 2013-12-20 22:25 -0700
        Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-21 21:06 +1300
          Re: Why Python is like C++ Chris Angelico <rosuav@gmail.com> - 2013-12-21 19:17 +1100
          Re: Why Python is like C++ Christian Gollwitzer <auriocus@gmx.de> - 2013-12-21 11:19 +0100
            Re: Why Python is like C++ Tim Chase <tim@thechases.com> - 2013-12-21 08:52 -0600
              Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-22 13:17 +1300
            Re: Why Python is like C++ Tim Chase <python.list@tim.thechases.com> - 2013-12-21 08:43 -0600
              Re: Why Python is like C++ Roy Smith <roy@panix.com> - 2013-12-21 10:59 -0500
                Re: Why Python is like C++ Tim Chase <python.list@tim.thechases.com> - 2013-12-21 10:29 -0600
                Re: Why Python is like C++ Chris Angelico <rosuav@gmail.com> - 2013-12-22 06:04 +1100
              Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-22 13:27 +1300
            Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-22 13:14 +1300
          Re: Why Python is like C++ Michael Torrie <torriem@gmail.com> - 2013-12-21 08:46 -0700
            Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-22 13:36 +1300
  Re: Why Python is like C++ Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 05:34 +0000
    Re: Why Python is like C++ Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-21 21:09 +1300
      Re: Why Python is like C++ Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 08:22 +0000
    Re: Why Python is like C++ Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-21 11:37 +0000
      Re: Why Python is like C++ Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 12:12 +0000
  Re: Why Python is like C++ Dan Stromberg <drsalists@gmail.com> - 2013-12-21 00:18 -0800
    Re: Why Python is like C++ Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-21 11:51 +0000
    Re: Why Python is like C++ Roy Smith <roy@panix.com> - 2013-12-21 10:10 -0500
      Re: Why Python is like C++ Terry Reedy <tjreedy@udel.edu> - 2013-12-21 17:03 -0500
        Re: Why Python is like C++ Roy Smith <roy@panix.com> - 2013-12-21 17:28 -0500
          Re: Why Python is like C++ Terry Reedy <tjreedy@udel.edu> - 2013-12-21 19:20 -0500
  Re: Why Python is like C++ Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-21 08:42 +0000
  Re: Why Python is like C++ Gene Heskett <gheskett@wdtv.com> - 2013-12-21 14:05 -0500

csiph-web