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 440599
To view parent comment, click here.
To read all comments associated with this story, please click here.
vivainio
Member since:
2008-12-26

If you have that, you can just release a small core and let libraries define all the fancy language features people like.


I've heard many things about Perl, but never heard it referred to as "small". Every time someone had an idea, they were sure to add it to the core language.

Python is small. It doesn't even support regular expressions in the core language (which is a design flaw both perl and ruby happily make), you'll use the standard library instead.

Reply Parent Score: 2

Neolander Member since:
2010-03-08

I've heard many things about Perl, but never heard it referred to as "small". Every time someone had an idea, they were sure to add it to the core language.

Python is small. It doesn't even support regular expressions in the core language (which is a design flaw both perl and ruby happily make), you'll use the standard library instead.

Python, small ? I can't agree with this.

C, Pascal, and their object-oriented derivatives, are what I call small languages. They have a feature list close to the bare minimum, except for some things like bitfields and enums in C. Python, on the other hand, with its inclusion and high-level manipulation of lists, strings, tuples, and dictionaries, is not exactly what I would call a small language...

Edited 2010-09-12 14:15 UTC

Reply Parent Score: 2

google_ninja Member since:
2006-02-05

I was talking about the benefits of a self modifying language, and was mostly thinking about lisp as I wrote that particular sentence

Reply Parent Score: 2

sreque Member since:
2010-09-10

Don't be so harsh on ruby! In ruby, the perl-like regular expression syntax is just syntactic sugar for using the Regexp class, which looks and feels like any other class in the language. In fact, if you wanted to, you could instantiate and use regular expression objects in ruby just like you would in python. No one usually does this, though, because the sed/awk/perl-like syntax for regular expressions is actually very convenient and helpful. I think this actually gives us the best of both worlds, because the language is still clean and consistent.

This stands in contrast to perl in many ways. For instance, in perl, if you want to assign a regexp to a variable you have to use the qr() syntax, which actually is much less convienent than the normal syntax for creating a regular expression. In ruby, you can just write something like:

re = /my_regular_expression/

which is just syntactic sugar for a properly string-escaped version of:

re = Regexp.new("my_regular_expression")

Reply Parent Score: 1