TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Rebuttal for Python 3

155 pointsby victorvationover 8 years ago

14 comments

jcranmerover 8 years ago
As this rebuttal points out, the original article basically finds two flaws in Python 3 and then tries to puff them up as much as possible. These two complaints are:<p>* Python 3 is not backwards-compatible with Python 2.<p>* Byte strings and character strings are different things so now I have to care about stuff.<p>Although I say that it&#x27;s two things, it&#x27;s really one thing since the main element of incompatibility is the byte string&#x2F;character string issue, since it&#x27;s that incompatibility that makes it hard to know what the right thing to do is.<p>Having had to deal with internationalization before, I can honestly say that there&#x27;s only one way to handle it: convert all string data to your internal representation (be it UTF-8 (Rust), UTF-16 (Java), or UTF-32 (Python)) at the margin where you read&#x2F;write it, and keep binary strictly separate from textual in terms of representation. This is what Python 3 does and what Python 2 doesn&#x27;t do. I have seen some people argue that Python 2&#x27;s model is better because it means that writing something like cat is harder, but that&#x27;s optimizing for the wrong thing. I&#x27;ve seen a build system written in Python 2 break for the sole reason that I thought to write 一 in the commit message.<p>As for the complaint that it&#x27;s taking 9 years for Python3 to slowly become the default instead of Python2, keep in mind that 15 years after the release of C99, gcc was still using C89 by default (gcc 5 skipped C99 and went straight to C11).
评论 #13028844 未加载
评论 #13036000 未加载
评论 #13032617 未加载
fao_over 8 years ago
This is a great rebuttal against such an awful book for teaching.<p>Last year I recommended this book for a friend that was starting to learn to program. After a few weeks I was talking to him about lists, and he didn&#x27;t understand what I was saying because it doesn&#x27;t touch a <i>basic concept like a list</i> until Chapter 32! It takes literally two seconds to explain to a person what lists are, maybe a little longer for syntax. Given that he invites people to read other people&#x27;s code early on (in one of the single digit lessons IIRC), this is a serious omission.<p>In addition to this, much of the attitude towards programming in the book isn&#x27;t so much of &quot;Woah! A new thing! It&#x27;s so cool let&#x27;s learn it&quot; (i.e. energetically curious), but tends to rebel against new things in a &quot;Well, I know it&#x27;ll be hard and difficult...&quot; way, which I honestly believe is damaging to new programmers. Programming is one of those disciplines where if you don&#x27;t have a positive spirit towards both bugs and learning new things, you will get worn down over time. I think it&#x27;s best to either already possess such an attitude or to show people documentation, etc. that helps them develop such an attitude when learning.<p>I ended up prodding my friend to pick up Lua. Partly because he was more interested in games development (and there is a great community for that around the Love2D engine), because it is a small enough language to learn and memorize in a week or two, and because I wanted to undo the damage that reading LPTHW had caused on his attitude towards programming.
soyiuzover 8 years ago
Mr. Shaw&#x27;s book used to be a decent starter reference. I liked his step by step short chapters, but there were some red flags. For example, he spent several early chapters on string formatters, which are neither terribly common nor useful for a beginner. Other key concepts like iteration were not adequately explained, or introduced far too late in the progression.<p>Besides the demagoguery, this new piece displays shocking ignorance of basic CS concepts. I will now actively warn my students against consulting his work.<p>Thanks to eeveee for a detailed rebuttal, which displays an appropriate amount of reprobation, given the original&#x27;s caustic tone.<p>Python is an incredible community effort. It deserves support and constructive participation.
bobjordanover 8 years ago
I certainly didn&#x27;t get Zed&#x27;s article, like maybe I&#x27;m not familiar with the superior toolings of other languages, but whenever I&#x27;ve used python2to3 I found it helpful enough to get real work done. For example, two years ago, I fell squarely in beginner segment skill wise, and I filed an issue with a repo owner to request to update to be python 3 compatible (an ORM for RethinkDB - <a href="https:&#x2F;&#x2F;github.com&#x2F;linkyndy&#x2F;remodel" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;linkyndy&#x2F;remodel</a>). The obviously talented repo owner initially responded he feared it would be complex and take a long time. I then spent a weekend to learn the library, used 2to3 to get 95% there, fixed the remaining small issues, and updated the repo to be compatible with Python 3, passing all tests. Sometimes these python2 programmers just do not want to change.
aorthover 8 years ago
Great point for point rebuttal. I was annoyed at the original article when it was circulated recently. As eevee points out, most of the original author&#x27;s points are invalid or unimportant, and to me it seems that he is just mad he has to write another &quot;learn Python&quot; book for Python 3.<p>I&#x27;m a Python beginner and I recently wrote a few small tools in Python 3. They have a few functions, do network I&#x2F;O, argparsing, connect to PostgreSQL, etc. It took me a few hours and it was fun.
_coldfireover 8 years ago
It&#x27;s human nature to resist change. Making a clean break and avoiding backwards compatibility was the smart move, it annoyed many, but I look around and see some languages truly suffering from such things years down the track.<p>Python3 is superior, its nothing but fandom when people say otherwise. Starting from scratch I&#x27;m yet to see any real benefit for 2, yet it still happens routinely due to the mindsets of some.
gnuvinceover 8 years ago
The original article by Zed should stand as an example of logical fallacies.
incompletewootover 8 years ago
Maybe Curmudgeon Driven Development is a thing. I was totally surprised that by the end he hadn&#x27;t advocated Perl 6. Like, &quot;This is how it should be done: Parrot in Perl 6&quot;.<p>I was hoping out of this kerfluffle that some one would make Python3&#x27;s TypeError show which variable was the byte string and the normal string. I haven&#x27;t seen any people argue for improving the error reporting. It&#x27;s that kind of thing that helps beginners when they start trying to do things with their current knowledge.
BerislavLopacover 8 years ago
I&#x27;m amazed how people always list &quot;three ways of formatting strings&quot;, when in fact there are four. :)<p>Admittedly, the fourth is not built-in, but it&#x27;s part of the standard library: string.Template
elmikoover 8 years ago
for all his points about adoption of python 3, i think an interesting data point is that many of the OpenStack projects are actively converting (or already have converted) to python 3. that&#x27;s no small amount of python.
chucksmashover 8 years ago
&gt; Zed Shaw, your behavior here is fucking reprehensible.<p>s&#x2F;here&#x2F;&#x2F;
zdeover 8 years ago
Ported all my code base to Lua. Python can die now.
pwdisswordfishover 8 years ago
<p><pre><code> # -*- coding: utf8 -*- print &quot;Hi, my name is Łukasz Langa.&quot; print &quot;Hi, my name is Łukasz Langa.&quot;[::-1] </code></pre> This is a bad example. Reversing Unicode strings isn&#x27;t an operation that is often needed in practice, and it shouldn&#x27;t be done codepoint-wise anyway, because some characters have to be represented with multiple codepoints:<p><pre><code> Python 3.5.2 (default, Nov 7 2016, 11:31:36) [GCC 6.2.1 20160830] on linux Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information. &gt;&gt;&gt; &#x27;x́q&#x27;[::-1] &#x27;q́x&#x27; </code></pre> Doing it properly is bit of a grapheme clusterfuck: &lt;<a href="http:&#x2F;&#x2F;unicode.org&#x2F;reports&#x2F;tr29&#x2F;#Grapheme_Cluster_Boundaries&gt;" rel="nofollow">http:&#x2F;&#x2F;unicode.org&#x2F;reports&#x2F;tr29&#x2F;#Grapheme_Cluster_Boundaries...</a>.
评论 #13031717 未加载
评论 #13033257 未加载
评论 #13030720 未加载
评论 #13035962 未加载
aprogrammerabover 8 years ago
It&#x27;s really not surprising to me that the original link to Shaw&#x27;s article is buried on HN.<p>This is exactly what he is talking about: it&#x27;s not about right or wrong anymore, it&#x27;s all about tribalism. I can remember when RoR was the newest, hip, thing in Silicon Valley. If you even mentioned something wrong with it on HN, you were silenced and downvoted.<p>There were real issues with RoR that needed to be addressed, but the community developers would rather spend time silencing opposing opinions that actually fixing the flaws in the language.<p>Where are these developers now? They all moved onto Javascript frameworks and node.js.<p>There are real issues with Python 3. The Python 3 faction of the community has basically told anyone that asks to fuck off and do things their way.<p>The responses here on HN and this &#x27;rebuttal&#x27; have really just proven his point. I would have rather it proven him wrong.
评论 #13033161 未加载
评论 #13032837 未加载