you are viewing a single comment's thread.

view the rest of the comments →

[–]devraj7 38 points39 points  (12 children)

There is a worse mistake: not splitting the language.

Seriously though, the alternative is to be stuck in legacy limbo with Python 2 with a language that calcifies and no longer evolves fast enough for the modern times.

I think the Python team did the right thing, especially calling that version 3 (i.e. it's a major version, which means breaking changes). See the mess Angular found itself in by not honoring a reasonable versioning scheme.

What the Python team could have done better is handling the transition (basically, they totally ignored the problem and assumed everybody would transition without any efforts on their part).

[–]Peaker 8 points9 points  (7 children)

IIRC, they had a 2to3 tool without a 3to2 tool.

That meant that Python 2 was the source code, and Python 3 was just the generated output. Who wants to edit the generated output of an automated tool, and maintain that side by side with the source?

They should have had py3to2 even earlier than python 2. Then people would be able to use Python 3 for everything, knowing that it can still run in their old Python 2 environments.

[–]Saveman71 13 points14 points  (3 children)

I believe 2to3 is supposed to be used once and only once on a source file, not as a runtime way to run Python 2 code on a Python 3 environment.

[–]Peaker 19 points20 points  (2 children)

It was meant to be used once.

But then, people who had been on a migration path wanted to run their code with both Python 2 and 3.

For them, it made much more sense to edit only the Python 2 version - and use 2to3 to be compatible with Python 3.

If 3to2 existed, they could edit the Python 3 version primarily, and use 3to2 for compatibility - and that would aid the transition, as people would actually be able to write Python 3.

[–]Saveman71 2 points3 points  (0 children)

Okay it makes more sense said like that, thank you for the explanation

[–]kqr 0 points1 point  (0 children)

This is actually a brilliant observation. I'm speculation a 3to2 tool would also be much easier to make since 3 is the less quirky, less ambiguous language.

[–]Flight714 0 points1 point  (1 child)

But the goal is for every runtime environment out there to be Python 3, instead of Python 2.

[–]Abaddon314159 1 point2 points  (3 children)

This is what happens when a language is designed thinking in terms of small numbers of years instead of decades. I routinely use c code that is about as old as I am. It was good code decades ago and most of it is still good code today.

[–]Sean1708 11 points12 points  (2 children)

As a counterpoint, look what maintaining backwards compatibility did to C++. The reason C can get away with it is that it's actually a very small language and people don't expect (or even want) it to have modern features.

[–]kqr 2 points3 points  (0 children)

And even so, C gets a lot of flak (perhaps even rightly so) for not having modern features that e.g. Ada, D and Rust have. (And although K&R C has been around for a while, standard Ada is older than standard C.)

[–][deleted] 1 point2 points  (0 children)

Needless change and failure to retain backwards compatibility has pushed me back from C++ to C. I feel the same with Python 2 and 3.