Hacker News new | ask | show | jobs
by xapata 3687 days ago
It's the same language. This is not the break between Perl 5 and 6 which was different languages only keeping the brand.

I find it very easy to write code which is simultaneously Python 2 and 3. A few ``from __future__ import`` statements and you'll be fine. The only reason some people are complaining is that they were ignoring bugs in their code regarding text data. It's not a Python problem, it's a problem with computers -- bytes are not text, but many systems ignore the difference.

Many large enterprises are starting new projects in Python 3 exclusively. It's fine if you want to use some Python 3-only syntax.

1 comments

> It's the same language.

No it's not. The syntax is what defines the language:

      In linguistics, syntax is the set of rules,
    principles, and processes that govern the structure
    of sentences in a given language.
It doesn't have the same syntax. It's not the same language, by definition.
Then why do we have two different words -- syntax and language? Python is a high level language, a bytecode, a standard library, and an interpreter (or many interpreters). You might also lump into that a culture, a community, and a Zen.

When we say it's the same language, most of those aspects are the same from Python 2 to Python 3.

With such definition python 2.5 and python 2.6 are different languages, because they have different syntax (python 2.5 does not support "with" statement).
Do you consider this definition to be nothing but absurd? I think it has a lot of merit.

What impact does one or other way of thinking (absurd vs has merit) about this (a potential break in backward compatibility between language versions due to any addition, removal or alteration of one or more language features) have on the language and its ecosystem and culture?

Imo:

* such potential breakage is relatively benign iff there's an easy-to-follow technique (eg using a linting tool or a program editor's search feature) that always ignores/accepts code compatible with the older language version and always catches/rejects code compatible with the newer language version.

* a further improvement on this is to have the inter-version checking done by a language's interpreters/compilers.

* best of all is when the language is at least partly compiled and compilation using the older interpreter/compiler does the rejecting at compile-time.

Samantics