How big can a Python program be?

V

vronskij

Hi,

A C program can be hundreds of thousands lines of code big.
C++ millions.

How about Python?

Suppose , you are a sole programmer (lonewolf). How many lines can one handle?

Thanks,


jan bodnar
 
P

Peter Hansen

A C program can be hundreds of thousands lines of code big.
C++ millions.

How about Python?

Suppose , you are a sole programmer (lonewolf). How many lines can one handle?

What are you actually asking? What technical limitations,
such as maximum line count per module, Python might have?

Or how productive the average programmer can be in terms
of lines of Python code produced per day?

Or something else entirely?

Note that lines of code is a pretty poor measure of productivity,
especially if you just use an average statistic, because it's
hard to judge whether those lines are bug-free or bug-ridden,
and because there is an extremely wide variation in productivity
between different programmers (one oft-published ratio is 30:1).

And more importantly than anything: why do you want to know
such things? This information is critical to providing you
with a useful answer.

-Peter
 
C

Christopher T King

Suppose , you are a sole programmer (lonewolf). How many lines can one
handle?

$ wc -l my_current_big_project_that_is_very_far_from_being_complete/*
2945

I'm sure others can do better than that.
 
P

Peter Hickman

Hi,

A C program can be hundreds of thousands lines of code big.
C++ millions.

How about Python?

Suppose , you are a sole programmer (lonewolf). How many lines can one handle?

Thanks,


jan bodnar

Are you suggesting that a solo programmer wrote a multi million line C++
program? If not then what has this to do with 'How many lines can one handle?'

The application I am currently working on has 75,000 lines across some 600
files. But I suspect that the line count is higher when you include the various
libraries. So I am handling 75,000 lines in some sense, is this what you mean?
Or are you talking about the number of lines per file (average 125) or perhaps
lines per method?
 
P

Paddy McCarthy

Hi,

A C program can be hundreds of thousands lines of code big.
C++ millions.

How about Python?

Suppose , you are a sole programmer (lonewolf). How many lines can one handle?

Thanks,


jan bodnar

Well, heres my quarter-million line Python 'Program' executing


pad@Williams-McCarthy:/tmp$ python -c 'print "x=0"
for i in xrange(2**18):print "x+=",`i`
print "print x"' > silly.py
pad@Williams-McCarthy:/tmp$ wc -l silly.py
262146 silly.py
pad@Williams-McCarthy:/tmp$ nice python silly.py
34359607296


It did start to swap but didn't take too long to finish on my 256Meg
Debian Linux, Athlon 1470MHz machine

:) Pad.
 
V

vronskij

Peter Hickman said:
Are you suggesting that a solo programmer wrote a multi million line C++
program? If not then what has this to do with 'How many lines can one handle?'

The application I am currently working on has 75,000 lines across some 600
files. But I suspect that the line count is higher when you include the various
libraries. So I am handling 75,000 lines in some sense, is this what you mean?
Or are you talking about the number of lines per file (average 125) or perhaps
lines per method?

Heh,

Are you suggesting that a solo programmer wrote a multi million line C++
program? If not then what has this to do with 'How many lines can one handle?'

No way. This was just another question. One programmer told me that
he
can roughly handle max 10 000 lines in C language. I was curious
about Python. I always hear that Python can be used on larger projects
than e.j. PERL because it is Object Oriented and cleanly designed.
What is a larger project? Mumbers revail more.
The application I am currently working on has 75,000 lines across some 600
files.

This is probably team work. It's helpful for me to know figures. When
you start a project it is useful to know the limitations of a
language. Visual Basic is reported to fail on larger projects.
 
T

Tim Jarman

No way. This was just another question. One programmer told me that
he
can roughly handle max 10 000 lines in C language. I was curious
about Python. I always hear that Python can be used on larger projects
than e.j. PERL because it is Object Oriented and cleanly designed.
What is a larger project? Mumbers revail more.

Of course 10,000 lines of Python will usually encompass much more
functionality than 10,000 lines of C, because Python is a higher-level
language, so you need to be careful you're comparing like with like. I
have never tried to write 10,000 lines of Perl, and would never do so
unless (a) I was being paid an obscenely large amount of money for it
and (b) I had a cast-iron guarantee that I would never have to look at
it ever again.

But a simple line-count is less revealing than actual project scope
IMHO. What does this 10,000-line C program actually do? How much effort
would it be to do that in Python? In a lot of cases, the answer will be
that it is much less effort in Python, and fringe benefits of that are
likely to include shorter and more legible code than you had in C. You
might be able to do it in APL in far fewer lines, but as to effort and
legibility... YMMV!

Tim J
 
P

Peter Hickman

No way. This was just another question. One programmer told me that
he
can roughly handle max 10 000 lines in C language. I was curious
about Python. I always hear that Python can be used on larger projects
than e.j. PERL because it is Object Oriented and cleanly designed.
What is a larger project? Mumbers revail more.

The problem is that some languages are much more verbose than others, thus a 100
line python program might require 2,000 lines of C or 700 lines of C++ (I'm just
making up numbers here). What then counts is the programmers ability to read the
source and summarise (oh, that's just creating back orders if we are out of
stock). The more verbose the language the more likely they will have a problem
comprehending the intent of the code. Imagine trying to comprehend a C program
against its assembly equivalent. C is easier to read than assembly and Python is
easier to read than C.

I suppose languages have a conciseness metric but I would not know how to
measure it. On the other hand APL is very short by just as hard to read.

Perl is used on some very large projects! The 75,000 lines I mentioned was Perl
and I would not count that as a large project.
This is probably team work. It's helpful for me to know figures. When
you start a project it is useful to know the limitations of a
language. Visual Basic is reported to fail on larger projects.

It was created by a team for sure but when an upgrade or fix is required then
only one programmer is looking at the whole of the code so they have to handle
the entire codebase. A well designed codebase / object hierarchy helps here.

As to Basic, the non VB sort, I have worked on financial systems that were
written in Vax Basic that were many 1,000s of lines long. The language is not
the problem. With VB the problem is that you never really got to work with the
code, the IDE was always in the way and the IDE only existed at the program
level and not the project.
 
V

vronskij

What are you actually asking? What technical limitations,
such as maximum line count per module, Python might have?

Well this is maybe difficult to define. Programs reach some limit and
become unmanagable. This is one reason why we have OOP, UML etc.

And more importantly than anything: why do you want to know
such things?

Simple. Can you make an ERP in Python? Or is Python limited to little
nice scripts or small programs with nice GUI?
We are thinking to start a huge project, which could be hundreds of
thousands of lines huge. I would finally know the answer, but it is
probably better to ask first...
 
5

510046470588-0001

No way. This was just another question. One programmer told me that
he
can roughly handle max 10 000 lines in C language. I was curious
about Python. I always hear that Python can be used on larger projects
than e.j. PERL because it is Object Oriented and cleanly designed.
What is a larger project? Mumbers revail more.

in scheme I may handle 1000 times more code than in any infix language

Klaus Schilling
 
P

Peter Hansen

Well this is maybe difficult to define. Programs reach some limit and
become unmanagable. This is one reason why we have OOP, UML etc.

Yes, that's true.

In this respect at least Python is fairly widely considered to
have a leg up on much of the competition. One of the biggest
reasons is that it makes the code much more maintainable
(because of greater readability for one thing) than the same
amount of code in many other languages would be.
Simple. Can you make an ERP in Python? Or is Python limited to little
nice scripts or small programs with nice GUI?
We are thinking to start a huge project, which could be hundreds of
thousands of lines huge. I would finally know the answer, but it is
probably better to ask first...

Ah, excellent... yes! No problems. In fact, I'm near certain there
was someone around here one or two years ago talking about making
a large ERP system in Python. Don't know who that was, or whether
they might have shipped it yet...

At my last place of employ, we used Python to develop a system
that had something like 60,000 lines of code that we wrote, and
which built on Zope (and, later, Twisted), which had I believe
over 100,000 lines of code. And of course a line of Python code
corresponds to quite a few lines of C code (one group's analysis
says it's a 10:1 ratio: http://www.pythonology.com/success&story=wingide).

Here are some other references for you:

http://mail.python.org/pipermail/python-list/2004-August/233130.html

http://www.pythonology.com/success

http://www.mindview.net/WebLog/log-0036 (Bruce Eckel)

This newsgroup's archives:

http://groups.google.com/groups?q=large+projects+group:comp.lang.python.*

-Peter
 
C

Cameron Laird

.
.
.
Simple. Can you make an ERP in Python? Or is Python limited to little
nice scripts or small programs with nice GUI?
We are thinking to start a huge project, which could be hundreds of
thousands of lines huge. I would finally know the answer, but it is
probably better to ask first...

Several of us have experience working with Python projects
which occupy hundreds of thousands of lines.
 
?

=?iso-8859-15?Q?Pierre-Fr=E9d=E9ric_Caillaud?=

Simple answer :
If you don't do it in Python, it'll be twice as big.

Think about the size of Python's library.
What kind of projetc is it ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,204
Messages
2,571,063
Members
47,670
Latest member
micheljon

Latest Threads

Top