[Python-ideas] Rosetta Code on Python.org site?

Steven D'Aprano steve at pearwood.info
Fri Oct 16 02:02:42 CEST 2015


On Thu, Oct 15, 2015 at 02:14:16PM -0700, Chris Barker wrote:
> On Thu, Oct 15, 2015 at 10:37 AM, Jason Schwerberg <jason at schwerberg.com>
> wrote:
> 
> > At risk of completely going off topic from the mission of Python-Ideas,
> > I'd almost rather see a delineation between Python 2 and Python 3
> 
> > While there are many ways to make 'good' code, compatible with both Python
> > 2 and 3, I think that the most terse, efficient code would be better
> > demonstrated by segregating Python 2.x from Python 3.x.
> 
> makes sense to me. RC is a wiki, yes? So it looks like this:
> 
> http://rosettacode.org/wiki/Rosetta_Code:Add_a_Language
> 
> Is what you need to do...
> 
> Or would there really  be strong objections from the community to having a
> Python3 section on the site?

I would object to adding Python 3 as a different language. It is not, 
and we should be emphasising the similarities, not the differences. 
Migration to Python 3 is slow enough without giving more ammunition 
("it's a completely different language, like Perl 6 is to Perl 5") to 
the foot-draggers and haters.

Adding Python 3 as a different language would be a strategic error, 
because most code snippets will be identical except for possibly 
print and (raw_)input. That's going to discourage people from adding a 
Python 3 version that is all but identical to the Python 2 version, 
which will increase the perception that nobody is using Python 3. 
("There are hundreds of Python 2 examples, and only a dozen Python 3 
examples.")

In my opinion, as far as Rosetta Code and similar sites go, all it takes 
to manage the Python 2/3 transition is a single comment at the start of 
the code snippet listing the version(s) targeted. I would consider that 
the minimum needed. Actually providing hybrid 2+3 code, or side-by-side 
versions, would be acceptible too, but that's more work.

I just looked at a small sample of arbitrary examples, and found that 
three out of the four already support Python 3, and the one that didn't 
just needed parens added to print to work.

So I don't think there's actually a problem here that needs fixing.



-- 
Steven


More information about the Python-ideas mailing list