We find code on web that are written for c or c++ that simply don’t compile with GCC at all because…
Alireza Savand
1

Well, in my own case, I will continue to write Python 2 while there is more stuff on the web for it, and if you are right, that will not last long, as people switch to Python 3. Then I would switch to 3 myself, using 2to3 for my existing code. But I am not happy with the way this is all playing out. One cannot deny that there is a problem — there would have been no need for your article if there wasn’t. I’d feel better if I could imagine that people sweated blood over this, trying desperately to minimize backward incompatibilities. But apparently not. For example, in merging ints and longs, they could have allowed people to still write 1L, which is unambiguous, but in 3, adding the ‘L’ causes a syntax error. Also, there was no need to insist that print always be a function. Python 2 might be called forward-compatible, in that ‘calling’ as if it was a function is fine: print(2 + 3) is the same as print 2 + 3. But Python 3 insists print is a function and must be called as one. Why not overload the keyword to let it be used as a statement? These are two of many cases in which they created needless backward incompatibilities. As for gcc, it does have flags, for example -ansi when compiling C code, and object code compiled with a previous version of the language can be linked with code from the current one. I can imagine a single Python interpreter which takes a -2 flag, and will run or import Python 2 precompiled modules. But of course the Python people not exist for my personal happiness or to drag dinosaurs like me out of the swamp. Having gotten as far as Python 2 from a start using decks of punched cards for Fortran and JCL, I am sure I can adapt to Python 3.

Like what you read? Give Douglas Pardoe Wilson a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.