Live data from Hacker News

The Case Against Python 3

learnpythonthehardway.org

231–240 of 281 posts

Re: The Case Against Python 3

#231
post #225

[Re-posting as a top level comment as I don't want to give the comment I'm replying to any more attention.] >> 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. The author is - quite obviously - staying the Python 3 VM should run Python 2 code, in the same way the JVM and CLR run other…

I took the time to read what Zed Shaw had to say, and I think that Zed is a bad journalist or public communicator, and the reaction on Hacker News is symptomatic of this. Zed Shaw had a straightforward (but probably wrong) case to make about Python 2to3, but instead he lacked the restraint from shooting himself in the face.

To be clear, Turing completeness is Zed Shaw's baseless launching point for discussing the incompetence or political nefariousness of the Python language devs.

Turing completeness does not mean a perfect translation between all languages exists. Genuine ambiguity can exist. If your language goes from 1 to 2 types, a perfect solution may be out of the question.

Re: The Case Against Python 3

#232
post #164
post #143

Anyone here remember "Rails is a Ghetto"? http://web.archive.org/web/20080103072111/http://www.zedshaw... Zed's Rails article did lead to some improvements in the Ruby community (eg: The 'pickaxe' had meta-programming added to the next version). Zed likes to stir things up, but rather than dismiss him completely over some nit picky issues, eat the meat and spit out the bones. To the "I stopped there" folks in this th…

Python3 is seeing poor adoption because for 5 years it was extremely hard to port existing code to Python 3. But there's been a lot of effort to fix this, and now the tools are in place to make porting easier. Since those tools are in place, pretty much every major Python lib has Python3 support. Many minor libs as well, though it's easy to have one or two dependencies missing it if your project is big enough. Applic…

> Application developers (overwhelming majority of Python users) had to wait for the libraries to get over to Python 3.

And, in the mean time, they were stuck with a language ecosystem which entirely stagnated; while there are some benefits to working with a "stale" language, this was even worse: it isn't like "the C language is no longer going to change, but gcc gets better every year, with better error messages and faster compilation and improved code generation", but "the developers of Python have decided to spend years working on something which you can't port to yet because you are blocked on libraries and libraries are blocked on tooling and language fixes, and in the mean time have gotten pretty damned hostile towards users of Python 2 and constantly claim that whatever the most recent release of 2.7 is is going to be the last one ever so people had better start moving"... and a lot of the people I knew who had been using Python have thereby moved alright, but they moved to Go, Rust, Clojure, or Elixir, and they aren't coming back to Python given that the language is really only slightly better than it was five years ago while these other languages have been going in really interesting places. And yes: there are some people using Python 3 now, but interestingly it seems to be an entirely different group of people, such as data scientists, than the people who were using Python 2: when was the last time you heard about a big website being developed using Python? You don't: that era ended when Python 3000 was announced.

Re: The Case Against Python 3

#233

Earlier quoted context omitted.

I'm pretty sure this was a tongue-in-cheek way of stating the true criticism.

I'm wondering that here. The whole article feels over-the-top, perhaps it's a well crafted parody, an extreme sense of sarcasm? May be he is a Python 3 lover after all.

Isn't over-the-top Zed Shaw's "thing"?

Re: The Case Against Python 3

#234
post #232
post #164

Earlier quoted context omitted.

Python3 is seeing poor adoption because for 5 years it was extremely hard to port existing code to Python 3. But there's been a lot of effort to fix this, and now the tools are in place to make porting easier. Since those tools are in place, pretty much every major Python lib has Python3 support. Many minor libs as well, though it's easy to have one or two dependencies missing it if your project is big enough. Applic…

> Application developers (overwhelming majority of Python users) had to wait for the libraries to get over to Python 3. And, in the mean time, they were stuck with a language ecosystem which entirely stagnated; while there are some benefits to working with a "stale" language, this was even worse: it isn't like "the C language is no longer going to change, but gcc gets better every year, with better error messages and…

There are loads of websites that get developed in Python. Django has gotten more and more popular every release. I work in a Python shop, and getting to Python 3 was something we've always wanted to do (and did! Recently)

Language communities evolve. Guido is working on a static type checker.

Python 3k transition was bad, but I haven't really met many people who are against the current state of the language. Re litigating the transition over and over doesn't accomplish much. Everyone knows how bad it was now

Re: The Case Against Python 3

#235
simple solution: there are two different languages that are pretty similar so let's just call them different names. suggestions? maybe python for v2 and some other snake name or python relative for v3?

Re: The Case Against Python 3

#236
post #229

Earlier quoted context omitted.

The most visible changes, such as print being a function, are the easiest and most trivial to adapt to. They clean up the language, and can be automatically converted from one to the other. This can be pulled into python 2 with "from __future__" imports. The harder part is the string handling. In Python 2, you have one class, string, which is performing two different jobs. It is acting both as a holder for text, and…

> In Python 2, you have one class, string, which is performing two different jobs. What? Have you used Python 2? No: in Python 2, you have two classes; one is called "str" and represents a sequence of bytes, and one is called "unicode" and represents text. The former is used while interacting with network protocols and files, and the latter is what you use internally in your program: at the boundaries you use .decode…

Yes, I have used python 2 quite often, as well as python 3. Python 2 is sloppy in this regard. You can use a "str" to represent text, and it will work perfectly, so long as you stay within the ASCII character set, setting up hidden bugs later. Telling everybody to just use u"", while correct, sets up "" as something that looks correct, but isn't. In addition, suggesting that "str" is a sequence of bytes, rather than a string, is rather inappropriate. The documentation refers to them as strings, they are created in similar manner to strings in other languages, and they are generally accepted by library methods that set text properties.

I agree that there were some changes that were unnecessary, like the removal of the u"" syntax. That said, I think that the fundamental change, which was to have the thing named "string" be a string, was the right choice. Python has always been about having the obvious choice be the correct choice. Telling everybody that "quoted text" is not text runs counter to this.

Re: The Case Against Python 3

#237
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.

First I spit my coffee when I read that too, but let me play devil's advocate (because I pretty much disagree with the entirety of his rant) : he's pointing out that since it's technically feasible to write a Python 2 interpreter in Python 3, and since it should even be pretty easy since the two languages do not differ immensely, then the only reason why it hasn't been done and there's no -2 flag to python3 has to be an ideological reason, a manipulation by the core devs to impose their ideas by force.

It's extremely badly conveyed but that's what I got out of it by keeping reading.

I do disagree with him on all the rest though, especially strings. It didn't "just work" before, it failed silently and who knows how much disaster he or his readers have caused because of it. Now at least you can't be wrong anymore. For a language heavily used on the web, it's hugely important to understand where your strings are coming from and where they're going to, and how.

Besides, Python is not a frigging "beginners language". Just because Python (and admittedly especially Python 2) is generally easy to grasp as a first language doesn't mean it's its purpose, nor should it constrain itself toward this goal. It's used in a million of different areas, including pretty sensitive ones. It's now become a more mature language, reaching for exactitude and consistency. Just because Zac no longer has an easy toy language to point script kiddies to so they can "learn to program" by reading one website doesn't mean Python is to blame.

Re: The Case Against Python 3

#238
post #225

[Re-posting as a top level comment as I don't want to give the comment I'm replying to any more attention.] >> 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. The author is - quite obviously - staying the Python 3 VM should run Python 2 code, in the same way the JVM and CLR run other…

> The author is - quite obviously - staying the Python 3 VM should run Python 2 code, in the same way the JVM and CLR run other languages.

There is no "CPython VM": no version of Python guarantees bytecode compatibility between versions. The bytecode is just an optimisation.

For a Python interpreter to support both Python 2 and Python 3, it would need to have have some source level way of telling the two apart. Bytecode doesn't even come into this.

> That the Python 3 VM doesn't run Python 2 code - and that the Python maintainers apparently say it can't - means the Python 3 VM isn't Turing complete.

No it doesn't. That's not what Turing Complete means.

Here's a pretty trivial way to demonstrate both Python 2 and Python 3 are Turing Complete: implement a Brainfuck interpreter in both. Brainfuck is Turing Complete (memory limits aside), and thus because you can implement a Turing Complete language in both Python 2 and Python 3, both are trivially proven as Turing Complete.

Zed's argument is like this: ARM processors can't run AMD64 code, thus ARM processors are not Turing Complete.

That argument is nonsense.

Re: The Case Against Python 3

#239

This has to be the ne plus ultra of Python scaremongering. It describes some sort of bizzaro world of a doomed language which it populates with Machiavellian Python maintainers, brainwashed developers, and a small group of heroic holdouts who see resisting Python 3 as a moral imperative. Apparently having too many string formatting options is a moral issue (three, to be specific). As someone who writes a _lot_ of Pyt…

If you're looking for a new tutorial for beginners, I really liked "Dive Into Python 3" ( http://www.diveintopython3.net/ ) and have had some success giving that link to new coders.

If Zed's understanding is correct, that would be a waste of time: The outcome would be that you learned a dead language.

Re: The Case Against Python 3

#240
post #35

Earlier quoted context omitted.

In my experience a lot of the problems with automatically converting existing Python 2 code to Python 3 code is that the Python 2 code usually makes fundamentally broken assumptions when it comes to unicode and bytes.

This is what the author doesn't get- the fact that Python 2 makes no distinction between bytes-like objects and string-like objects is a bug , not a feature . He finds his code so awful to migrate because he has built it on a contrary assumption.

Definitely disagree. I am a literal genius, wrote compilers, learned a dozen programming languages for fun, but prefer to do hard things. Yes p2 handling of coding is broken, but p3 is much worse. Making a theoretical argument about a pragmatic problem is a category mistake. And it's not even the core of Zed's expressed concern, which is the arrogant and abusive manipulation of the user community in service of the interests of self-obsessed project.
Post reply on HN