Page 2 of 2

Re: How many versions do I need? !!!

Posted: Sat Apr 29, 2017 5:06 am
by gkreidl
kusti8 wrote:The point is that python 2 and 3 is more like C and C++, although with less drastic changes. Python3 was an effort to try and fix all the mistakes that were in Python2 and make it less quirky and more functional. Could they have made it backwards compatible? Sure. But that is a ton more work and also makes that their buggy Python2 version will forever be around. It was a big overhaul. I don't really see what the problem is though. I program in Python3, not Python2 and if there is some library that isn't in 3 I just move on. It also helps that Arch linux has python symlinked to Python3 not Python2 like most systems.
Nothing to do with "mistakes" and "quirks" but simply a question of language design. After developing it for a number of years they came to the point where they thought, that some things should have been done differently form the beginning. But breaking compatibility is always a hard decision, especially for a programming language. So now we have two, Python 2 and Python 3.

I think the oldest Python code I have (not my own), has been written for 1.3 and still runs without changes with Python 2.7.9. There are millions of Python programs out there, which have been working for many years and so there is no reason to change anything.

Re: How many versions do I need? !!!

Posted: Sat Apr 29, 2017 5:11 am
by gkreidl
Martin Frezman wrote:
The already do. It's called 2to3. Or you could also use six.
OK - good to know.

The next step, then, is, of course, to build that functionality into the Python 3 interpreter, so that it can run either kind of script. Problem solved. On to the next.
Sorry, but this is complete nonsense. The meaning of some basic data types has changed (str, unicode, byte). You cannot mix that in any kind of "compatibility" mode. It would be a nightmare.

Re: How many versions do I need? !!!

Posted: Wed May 17, 2017 11:07 am
by pd2
TideMan wrote:Whereas Fortran IV code from the 1960s will work fine with the latest gfortran compiler.
Ahhhh! Fortran the first language that I learnt at Uni, I think running on a PDP11.
Ohhhh! Dropping those punched Hollerith cards on the stairwell.

Thanks for the informative replies on Python. Can't say that I like the language much though. Documentation and examples are of variable quality and also mixed between versions which is often not clear. Still I suppose it is easier to program than 6502/Z80 Assembler...

Re: How many versions do I need? !!!

Posted: Wed May 17, 2017 11:20 am
by jamesh
pd2 wrote:
TideMan wrote:Whereas Fortran IV code from the 1960s will work fine with the latest gfortran compiler.
Ahhhh! Fortran the first language that I learnt at Uni, I think running on a PDP11.
Ohhhh! Dropping those punched Hollerith cards on the stairwell.

Thanks for the informative replies on Python. Can't say that I like the language much though. Documentation and examples are of variable quality and also mixed between versions which is often not clear. Still I suppose it is easier to program than 6502/Z80 Assembler...
6502/Z80 are pretty easy....