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 440684
To view parent comment, click here.
To read all comments associated with this story, please click here.
Delgarde
Member since:
2008-08-19

I've used the phrase "well, mainstream", so you don't have to understand it literally. What I meant is that syntax looks more like some other popular languages, like Java, JavaScript or C#.


That's a funny thing to say, given that Perl has a loosely C-style syntax like Java, Javascript, and C# - it uses braces, and semicolons, favours symbols over keywords, etc.

Whereas Python has a completely different syntax - indenting rather than braces, keywords rather than symbols, etc. I love Python, but I'd certainly never say it's syntax looks like any of the languages you describe...

Reply Parent Score: 2

trenchsol Member since:
2006-12-07

Ok, maybe not syntax, but approach, logic. Java, Javascript or C# person will learn Python much faster than Perl.

Python syntax for objects and classes is more common with Java and C# or even PHP. Perl looks strange to Java and C# crowd. Python not so much, after you get used to mandatory indentation.

Reply Parent Score: 2

sorpigal Member since:
2005-11-02

So in the end your argument comes down to "Perl OO is weird and different" -- well no kidding, every Perl programmer in the world has concluded that. It's why we have Moose and why that was one of the first things to be fixed in Perl 6. Perl OO sucks! Is there anything *else* that's fundamentally wrong with Perl?

Before you say "Readability" I will say "It's true," but only to a point. Perl is much more permissive and lets you get yourself in to readability trouble more easily than many other languages, but with a little discipline readable code is not hard to write. Any decent perl monger will do it as a matter of course.

Now *Python*, there's a readability nightmare! I've been programming for a decade and tried to muddle my way through a moderately complex Python program the other week to make one, small change (add an additional menu option which calls existing code, just for faster access). It took me four *hours* to get it working! For a one line change. And I *still* don't understand what all of the magic going on was.

You *can* write readable python code, but I've seen more than a few programs that are terse and mystifying, relying on implicit behavior, and so on. Weird syntax doesn't help, either.

For the record I know many languages from many families, just not Python.

Reply Parent Score: 2