python vs perl lines of code

Edward Elliott nobody at 127.0.0.1
Thu May 18 18:09:52 EDT 2006


John Bokma wrote:

> "akameswaran at gmail.com" <akameswaran at gmail.com> wrote:
>> It seems to me the discussion could actually be beneficial.  If several
>> different coders gave similar responses, ie code line/character count
>> comparisons, we might be able to see if there is a trend of any sort -
>> the more "anecdotes" given and we start to have trends - or maybe we
>> don't.
> 
> What's the point? So you can say: Perl code has on average 1.727 more
> lines compared to Python?

That's more than we know right now.  You never know what data will reveal
until you collect and analyze it.

BTW I'm not limiting this discussion to lines of code.  That was simply the
most convenient metric available.  If people have other metrics to
consider, by all means post them.


> What's the point, both are tools. People who use both Perl and Python pick
> one to solve a problem because they want to pick what they believe is the
> right tool. I doubt that the number of lines is often on their mind.

What's the point in learning trigonometry?  People who survey land just want
to mark off boundaries, not solve a bunch of equations.

The Pythagoreans built a religious cult on the study of geometric figures. 
They didn't know or care that their discoveries would be useful in
engineering and science.

More knowledge = more choice = better tools.  When all you have is a hammer,
everything looks like a nail.  It's as simple as that.  If you're happy
playing with your hammers, fine.  Go away and post in some other thread.

 
> People who just know either Perl or Python don't care much about such
> figures, or so I hope.

I don't know Ruby, but if you could show me it produced significantly
shorter code with comparable readability to Python, I'd certainly look into
it.


>> Lastly, Ed - can you post the code?  That may be putting your head in
>> the lion's mouth so to speak and make the whole thread even worse - and
>> your coding style will get shredded by perl advocates... ok nevermind
>> don't post it.'
> 
> And not by Python advocates?

I don't care who rips my code to what.  I haven't posted code because people
will dissect it to death and lose sight of the big picture.  Code can
always be improved, it's a question of resources.  The point is not what
could be done better in my code, but what was done with my skill and my
time committment, and what others have done with their skill and their time
committment.

At some point I may post small snippets of each so others can gauge my style
and experience, but I'm afraid it will devolve into a code crtitiquing
fest.

 
>> Ok I'm going to end with a flamebait - but I would posit, ALL OTHER
>> THINGS BEING EQUAL - that a smaller number of characters and lines in
>> code is more maintainable than larger number of characters and lines in
>> the code.
> 
> And I think that's why a lot of people posted very negative, in the hope
> that people would not be tempted to make the above very dumb statement.

That's not a dumb statement, it's a sensible and testable hypothesis.  The
more people post their own experiences, the more patterns emerge and
testable hypotheses form, which can then be confirmed or debunked with
further study.  The journey of 1000 miles starts with a single step, etc,
etc.  Didn't your mother ever tell you how science works?  It's not all
bunsen burners and test tubes.

To everyone who thinks this thread is pointless or a bad idea: please just
go away.  Your objections have been noted, at this point you're not
contributing anything to the discussion.

-- 
Edward Elliott
UC Berkeley School of Law (Boalt Hall)
complangpython at eddeye dot net



More information about the Python-list mailing list