Linked by Thom Holwerda on Fri 10th Sep 2010 14:59 UTC
General Development Python programmers shouldn't get too smug. While many people agree that Python is designed in a way that makes it a highly readable language, there can still be problems with legacy, untested Python code too. Porting legacy Perl to Python can be a daunting task. In this article, learn some of the theory behind dealing with legacy code, including what not to do.
Thread beginning with comment 440344
To view parent comment, click here.
To read all comments associated with this story, please click here.
Bill Shooter of Bul
Member since:
2006-07-14

Yeah, readability might be worth it, IMHO.

You can write elegant, easy to read code in perl, though that is the exception more than the rule. With Python readable code is re rule, rather than the exception.


Perl's big, huge advantage, is that its installed on just about every *nix server.

Reply Parent Score: 3

sreque Member since:
2010-09-10

We managed to compile Python 2.6 on an AIX 5.2 server without incident. Perl does have an advantage here, but it's only really an advantage when you are distributing scripts to customers that have no interest in installing Python on their servers, and I believe this case is very rare.

Reply Parent Score: 1

Bill Shooter of Bul Member since:
2006-07-14

Well, I occasionally help out friends maintain their websites. Which means I log into random shared hosting boxes, whos OS and software installed I can't control. Often times, there are batch operations that I could fix easily with a script. I can't count on python always being there, but perl is always there.

Reply Parent Score: 2

ebasconp Member since:
2006-05-09

I know that everything is about tastes and likes, but I never did find Python code readable (Perl neither). I actually find C++/Java/C# and that family far more readable.

Reply Parent Score: 2

Bill Shooter of Bul Member since:
2006-07-14

I can read both just fine, so I'm not sure I could call one more readable than another.


Its like asking me which word is easier to read "this" or "that". One one hand "this" has more unique letters than "that", but the letter 'i' is a simpler shape and less varied in representation than 'a' that you'll find in "that". On the other hand "i" can be confused with a lower case "l" as well as the number "1" in many cases.

Reply Parent Score: 2

google_ninja Member since:
2006-02-05

its funny, longCamelCasedFunctionNamesMakeMyEyesBleed while wide_casing_almost_seems_like_english.

Reply Parent Score: 2

modmans2ndcoming Member since:
2005-11-09

I have no problem reading any code put in front of me (well... getting out into Functional land can get a little crazy). The largest impediment to understanding what code is doing is how the developer writes it.

If you like to be super concise and you want every line to be as dense as possible, then you code is going to suck to read. If you like to spin off objects for every little operation in your code then your code is going to be hard to read. If you like to keep your variable names to 5 characters or less, then your code is going to be hard o read.

Edited 2010-09-12 13:13 UTC

Reply Parent Score: 2