python vs perl lines of code
nobody at 127.0.0.1
Thu May 18 01:50:05 CEST 2006
Adam Jones wrote:
> Without any more information I would say the biggest contributor to
> this dissimilarity is your experience. Having spent an additional five
> years writing code you probably are better now at programming than you
> were then. I am fairly confident that if you were to take another crack
> at these same programs in perl you would see similar results.
I am in complete agreement with that statement.
> One of the bigger differences might have been language changes over
> time. If you had written this in python five years ago (assuming the
> python rewrites are relatively current, otherwise this list gets
> bigger) you would not have generators, iterators, the logging package,
> built in sets, decorators, and a host of other changes. Some of these
> features you may not have used, but for every one you did python would
> have had more weight.
> Other than that it all boils down to how the algorithm is implemented.
> Between those three factors you can probably account for most of the
> differences here.
s/probably/maybe. The factors you list are certainly big contributors, but
are they most of it? I don't know, there are good arguments both ways. If
you removed those factors, would the resulting python be shorter, as long
as, or longer than the corresponding perl? Would that mean anything about
code complexity, readability, maintainability, etc? I'm not comfortable
drawing any conclusions, but asking the questions is good.
> The real important question is: what has perl done in
> the last five years to make writing these scripts easier?
That's another very good question. One I can't answer.
UC Berkeley School of Law (Boalt Hall)
complangpython at eddeye dot net
More information about the Python-list