Live data from Hacker News

The Case Against Python 3

learnpythonthehardway.org

101–110 of 281 posts

Re: The Case Against Python 3

#101

The argument is bad but the headline has a point: the value of a language is the quality of its libraries and the community that maintains it. Python 3 seems like a mistake; it fractured the community and sent people away. (to golang, to scala, probably even to ruby). If I were a library maintainer on py2 I would have felt betrayed by py3. Suddenly print is a function? 'yield from' won't be available on the py2 branc…

>C++ is an example of the serious negative consequences of language change. From the outside looking in (as a non-C++ developer), for me the bigger problem is honestly that they left in the warts rather than just paving around them. Those who have followed C++ for its entire life cycle have probably been able to mostly keep up with what language features were mistakes and what the best way to do things is, but I can'…

On c#, the numerous core libs that don't meaningfully support nullable primitives is the most infuriating thing.

Re: The Case Against Python 3

#102

The argument is bad but the headline has a point: the value of a language is the quality of its libraries and the community that maintains it. Python 3 seems like a mistake; it fractured the community and sent people away. (to golang, to scala, probably even to ruby). If I were a library maintainer on py2 I would have felt betrayed by py3. Suddenly print is a function? 'yield from' won't be available on the py2 branc…

> Suddenly print is a function? from __future__ import print_function Now you've got print function in python2. > 'yield from' won't be available on the py2 branch? And 2.6 doesn't get set literals. And 2.5 doesn't get "with" statements. And ... There's got to be a cutoff somewhere. Or we'd just have an eternal 1.0 with all the features backported to it.

Well no. The problem is that py3 breaks backwards compatibility, without really a good reason. What's so much better about it? Why couldn't they sort py2 at least for module imports?

Which is exactly opposite for c++11 - it doesn't break backwards compatibility, but I really want those new features. I think if it broke backwards compatibility, I'd still switch to the new c++.

At work we use py2 and c++11...

Re: The Case Against Python 3

#103
This perhaps indicates a new level of maturity on the part of the author? I'm almost sad that this essay lacks words such as "fk" and "st". The title would have been more interesting if it had been "Python 3 is a ghetto". I was waiting for the part where he wrote "Ever since then Guido Van Rossum's been a mouthy little shit with nothing to back it up." And I very much wanted to read the part where he challenges Rossum to a fight. And yet, this essay is much more solid than some of the older essays. Less entertaining, but much more solid. And I found myself agreeing with this one.

Re: The Case Against Python 3

#104
post #48

Apart from his argument that Python 3 is not turing complete, which has been torn apart in the comments, can someone evaluate the other arguments. Are the other criticisms valid? If not, why?

I think some are valid criticisms, but not valid enough to throw your toys out of the pram.

> Not In Your Best Interests

I say what's in my best interest and py3 fixed a lot of issues for me. I'm happy with the upgrade and dropped py2 for new projects this year.

> No Working Translator

A flawless translator is simply not possible. 2to3 is the best effort idea. At some point you'll run into `def f(x): return x[0]` and without doing a full program static analysis you won't be able to say what's the right translation. You have to do it manually where needed.

> Difficult To Use Strings

I understand that the py2's "just works" strings are easier. But at the same time, having a non-ascii name I know that most applications "just work" simply because nobody actually tested them outside of ascii set. Py3 doesn't explode on encoding for fun - it basically says: you made an assumption that kind of worked so far by accident, but now you need to say explicitly what you want to do. I think it's a good thing, even if it takes people time to adjust.

> Core Libraries Not Updated

I don't even know what he means. This really needs an example, or it's just a meaningless rant.

> Purposefully Crippled 2to3 Translator

As above. Some things are just not possible to translate without knowing what the programmer meant. Some things in py2 strings happened to work a bit "by accident" and simply won't work in py3 for good reasons. For example py2 code:

    In [1]: "abc".encode('ascii').encode('ascii')
    Out[1]: 'abc'
It may look silly on one line, but there's lots of applications that relied on py2's "it just works" strings - and this what was effectively run at some point in the code logic.

Re: The Case Against Python 3

#105
post #68
post #54

Earlier quoted context omitted.

Node is an interpreter for the v8 JavaScript engine and it uses a language named JavaScript. There isn't a language named node :) I've done Python about as long as you but also like Golang for things Python is awful at.

Javascript is a colloquial name for what is formally known as ECMAScript. There isn't a language named JavaScript :)

You might just be being facetious, but in case you aren't, that's not true. The EMCAScript specification was based on JavaScript, not the other way around, and there are EMCAScript implementations that are not compatible with JavaScript (e.g. ActionScript, JScript). That is, JavaScript is one of many implementations of the EMCAScript standard, in and of itself it is not simply EMCAScript.

Re: The Case Against Python 3

#107
post #2

> Currently you cannot run Python 2 inside the Python 3 virtual machine. Since I cannot, that means Python 3 is not Turing Complete and should not be used by anyone. I stopped there.

I also can't run Python 2 by passing it into a C compiler. Man, I should publish a paper on this- they thought C was Turing-complete, but I proved them wrong!

Stop, it hurts. Too much.

Re: The Case Against Python 3

#108

"It's sad to watch Python destroy itself because it's such a great language, but that seems to be where things are headed." The author has a point here. I've been programming Python for about 10 years now. Really concerned about the future of the language. Languages like Node and Go are progressing rapidly, but what's happening to Python? I used to complain about Node, but with the latest ES6/ES7 improvements it's ac…

> what's happening to Python?

Great things, IMHO. Now that the painful changes of 2 to 3 are done (or nearly so), recent releases have focused on incremental and steady progress. Take a look at the "What's New" documents:

https://docs.python.org/3.6/whatsnew/3.6.html https://docs.python.org/3/whatsnew/3.5.html

There is a lot of great stuff there without ripping up the world and breaking all your programs. For example, the new compact dict implementation in 3.6 is a great improvement. All Python programs can potentially benefit from the memory use reduction. Bug fixes and improvements to library code are great.

The transition from 2.x to 3.x was not handled well. The core Python team should have focused much more on making transitioning code easier. Allowing code that can easily run in both 2.x and 3.x (with suitable shims like 'six') should have been a focus early on. Disallowing 'u' prefix on strings in 3.x is an example of a serious mistake. The argument of keeping 3.x pure was wrong. It is much more important to make transition easier rather than making 3.x extremely pure. That's something that C++ has got right, although maybe they went too far the other way.

My small contribution to transitioning 2.x to 3.x is "ppython". See my github repo:

https://github.com/nascheme/ppython

Now that I've been programming in Python 3 for a few months, I find it pleasant. Writing programs that handle Unicode text correctly is easier. For small programs, it is easy to make them run under either Python 2 or 3.

Re: The Case Against Python 3

#109
post #10
post #2

> Currently you cannot run Python 2 inside the Python 3 virtual machine. Since I cannot, that means Python 3 is not Turing Complete and should not be used by anyone. I stopped there.

Yes, the author doesn't know what he's talking about. But people talking about Turing completeness in a real programming language (usually in the form of "x is Turing complete, therefore you couldn't ask for more") almost always haven't got a clue.

True. No programming language has infinite tape.
Post reply on HN