COCOMO - appropriate for languages like Python?

Jonathan Hogg jonathan at onegoodidea.com
Mon Jul 8 17:05:09 EDT 2002


On 8/7/2002 19:42, in article
mailman.1026153791.18801.python-list at python.org, "Skip Montanaro"
<skip at pobox.com> wrote:

>   Andrae> Hint:  Do-not use gets()!!!
> 
> Thanks for the elementary C security tutorial, but it really wasn't
> necessary.  I wanted to use gets() because it was semantically the closest
> to file objects' readline() method (read a line from sys.stdin in this
> case).  Yes, I could have used fgets(s, 80, stdin) or something similar.
> That wasn't the point of the post.  I was asking about COCOMO.

I thought the point was very valid. COCOMO is about fully-debugged lines of
code. Andrae pointed out that your comparison was false because the lines of
C code were clearly not "fully-debugged" and thus not comparable.

Adding in the code necessary to implement comparable functionality results
in a 30x increase in lines of code - and this doesn't even include any
exception processing necessary to raise an appropriate error condition if
the file isn't open or some other I/O error occurs.

Comparing bits of code in-the-small almost never yields anything useful.
COCOMO follows out of the ability of the brain to process and manipulate
information. One can always write very sparse or very dense lines of code
that break the model, but in-the-large programmers do not normally do that.
They tend to write code in lines that fit easily in their head and, because
of this, one line of code is pretty much comparable to another.

Jonathan




More information about the Python-list mailing list