Hacker News new | comments | show | ask | jobs | submit login
Learn Python 3 the Hard Way (learncodethehardway.com)
82 points by alrs 11 months ago | hide | past | web | favorite | 73 comments

People wanted LPTHW removed from beginner programming resource lists because Zed actively spreads misinformation about Python 3.

He writes condescending articles that confuse and mislead newcomers to the language. From his redaction:

> In the previous version I trolled people by pointing out that, if what the Python project says is true and it would have been "impossible" to support Python 2, then they broke it and Python 3 is not turing complete. Obviously Python 3 is turing complete, but Python project members frequently claim something this basic is "impossible" soooooooooooo alright. I even had a note after the gag saying it was a gag, but everyone is too stupid to read that note even when they do elaborate responses to my writing.

Check out the past HN discussion on his article, "The Case Against Python 3": https://news.ycombinator.com/item?id=13019819

Reading the article, I was a bit disappointed that people were trying to pull the book, but reading your comment I remembered how much I had to argue for Python 3 with a friend who was just starting to learn programming and was reading LPTHW because I had suggested it after hearing it is a good book.

The book apparently said that Python 3 sucks, that people shouldn't learn it, and that "if someone tells you to use Python 3, tell them you'll use it when all their code is in Python 3", which is just absurd. It was very harmful, because Python 3 is definitely where the community is, and 2's days are numbered.

That part may have been true back when it was written, but it's definitely not true today, and all it does is fan the flames of discord.

Please everyone put down their fists and let the war finish.

It's all good. We all agree to program with Python 3 and educate beginners on Python 3.

Just forget the past and move on - Zed is on the Python 3 boat now and that's all that matters.

Indeed it makes a great deal of sense to not just end the conflict but go the other way - the Python community should simply ignore the past and do everything it can to welcome and include and bring Zed into the Python 3 community, to the extent that he wants that.

One would be wise to remember Zed's melodramatic exit from the Rails community. Once is surprising, twice is a pattern; reading the bitching about the PSF in this piece, I suddenly remembered the nearly identical bitching (including the le Carré style yarns of intrigue and "trusted associates" with chat logs) about certain folks in the Rails community. Read between the lines, and you almost identify a complete unwillingness to accept personal blame for anything: in "Rails is a Ghetto"[0], he claimed Rails and Mongrel ended his career and made him homeless -- which is odd, given the astronomical growth of Rails. In this essay, he claims the PSF is actively trying to suppress him for Reasons. So he responds to that by charging money. Come on. Think about that for two seconds.

I'm amazed that people still don't read Zed Shaw objectively in 2017. Zed is not a friend of any community except his own, including appeals to violence, and he has repeatedly shown that. I think it's extremely important to keep in mind the person being dealt with here and his history, because he absolutely does create toxic drama within communities (including in this thread, right now).

[0]: http://harmful.cat-v.org/software/ruby/rails/is-a-ghetto

Replying to a comment that says to leave the past to the past by pointing out a time in the past someone did a thing.

Maybe Zed burns himself over Python3. Maybe not. It doesn't really matter because he's gonna keep doing what he does, both good and bad. He's as human as the rest of us.

If there is a pattern here, I think it's definitely useful to describe it. The goal is not to fan the flames of this particular controversy, but to detect and neutralise this kind destructive behaviour when it occurs in the future (whether it's Zed doing it or someone else).

Yeah, I can see the validity in that. This industry is ripe for "loud" personalities with a contentious point of view. Zed is just an extreme example with that. I have a soft spot for him because I started with LPTHW, and I dont really care about the Python community either way.

If that was your introduction to Zed, I can certainly understand your perspective. Just know that these are deep, deep waters with a lot of unnecessary grief across more than a decade, and a lot of different perspectives who will disagree with you based on additional experience.

> Maybe Zed burns himself over Python3. Maybe not.

Definitely not. https://zedshaw.com/2016/11/24/the-end-of-coder-influence/

Do these fires start on Reddit or Hacker News or Twitter or something? They start with Zed Shaw.

And even this one, when Zed Shaw is talking peace and bridge building, he still echoes the position that Python core developers are of low character. His retelling of history is ungenerous. How do you extend an olive branch like that?

100% agree with this in general and specifically. People tend to get too hung up on issues that are over. Zed has moved on and so should everyone else.

Writing an article that very charitably wildly misrepresents events while leveling accusations at the PSF is not moving on.

I've recommended LPTHW to several new programmers, including one who I think bought the videos and really liked it.

Nonetheless, his strange dislike for python3 and continuing this flame war is not helping anyone, least of all Zed.

> Since I released the book in 2010 I have given it freely to about 12.5 million people.

Amazing, what an achievement!

> Before my books there was this general belief in computing that only “special” people could learn to code, and that it was pointless to teach anyone who didn’t start when they were 12. ... Before I wrote Learn Python The Hard Way programming education books either patronizingly assumed you were a child, or assumed you’d already been programming for years.

Hmm, I don't think this book was as revolutionary as described, but that doesn't take anything away from how good Learn Python the Hard Way is.

> Then I recently found out that members of the Python Software Foundation (PSF) have been actively trying to have my book removed from other books and websites. I received several chats logs from trusted associates that show PSF members contacting authors and demanding that they stop referencing my books. Believe it or not, it’s because I said Python 3’s strings suck or that Python 3 sucks. I’m not kidding. They are so petty that they are actively trying to destroy the one book that is potentially helping the most people become Python programmers simply because…I don’t like how they implemented Python 3.

WWWWHHHHAAAATTTT???!! If this is true, the Python Software Foundation should be ashamed.

> If this is true, the Python Software Foundation should be ashamed.

It's true and seriously misleading.

He's edited it a lot since (and even toned down its title), but the blog post he wrote against Python 3 was a FUD-filled incoherent piece.

You can absolutely expect members of the Python community to be disappointed. A lot of those members are people who learned from Shaw and to see him write a piece like that is heartbreaking.

The people on /r/Python who called for the removal of links to his resources (because yeah, it's not the PSF actively seeking out websites, it's the websites' members wanting him gone), those people were not "out for vengeance", they were not willing to link to material which actively campaigned against where the community was moving to.

He may be trying to position himself as one, but Zed Shaw was not a voice of reason who would point out the Python 3 flaws which nobody else dared criticize. Plenty of others criticized Python 3. Zed was actually trying to harm the move to it.

Congrats on the book, and I'm glad he changed his mind, but I have no sympathy to his complaints there.

PS: This is what happened to processing durations when I upgraded our Hearthstone log parsing pipeline from Python 2.7 to Python 3.6 after Amazon finally made the latter available on AWS Lambda: https://twitter.com/Adys/status/878985322436206592

> Plenty of others criticized Python 3. Zed was actually trying to harm the move to it.

This is exactly right, Jerome. I remember Armin being quite vocal against Python 3, but Zed was actively harmful, telling people to stay with 2 even though it was abundantly clear that 2 would not be supported by anyone any more.

Your last point is slightly misleading, you're comparing Python 3.6 (2016ish) with Python 2.7(2008), it better be faster

I just meant to include that as a real world example of the effects of upgrading from 2 to 3. But the blog post in question does date back to 2016 so I don't know how that's unfair :)

It's actually comparing 2.7.12 (2016) with 3.6 (2016).

Not that the release date has much to do with the benchmark, mind you...

Hardly matters since 2.7.xx are all maintenance releases and practically no features or performance improvements

Which is exactly why it's ok and not unfair to compare the performance improvements over time of Python 3.6 versus Python 2.7?

The point is that even at that time, Zed was advocating staying on py2 because py3 had no future, or wasn't turing complete, or whatever is complaint du jour was.

No, the author of these books should be ashamed. He was part of the reason it took 10 years for Python 3 adoption to get to where it is today. He wrote very nasty things about python3.

I attended pycon a couple of years ago and was still new to python. I had (tried to) read "Learn Python the Hard Way" as well. I attended many of the "newbie to python" tutorials while at the conference and many of them had this book as a suggested read. I promptly informed the tutorial leaders how the latest version instructed people to never install python 3 and spoke ill of it as if ignored, python3 would just go away (note the tutorial classes where all in python 3). Most people seemed shocked by this but they all removed the recommendation for the book.

Flame me all you, but I was trying to jump ship from Perl (which (un)fortunately didn't really work as years later I still make most of my money from Perl stacks). And the last thing I wanted to jump from was one language that had a giant rift in the community (perl5/perl6) to a "newer" "better" community that had the same rift in it as well. Thankfully people seemed to come to their senses over the last couple of years and have started to throw out their python 2 code.

>No, the author of these books should be ashamed. He was part of the reason it took 10 years for Python 3 adoption to get to where it is today. He wrote very nasty things about python3.

He played an insignificant parts compared to the large incompetence shown by the team that decided Python's 3 feature set and handled the transition.

In general, whoever decided that such few features (in the initial versions) and such lacklustre fixes should be enough to make people adopt an incompatible version of the language.

They still did it better than the Perl people, so there's that.

I don't remember the Python team ever advocating a move to 3.0, or 3.1, or 3.2 for that matter. IIRC those versions were out there so we could start looking at how things will change.

It's Python 3.3 where migration started being a serious matter of discussion, and 3.4 added more 2.7 syntax backports to help the transition. And the community did follow on that. 3.3 and 3.4 are where many 2.x libraries added Python 3 compatibility.

Calling the Python core devs incompetent for something where instances of prior art can be counted on the digits of one hand that may have lost a few fingers is a bit rich.

Doesn't really matter. The "core" team decided based on user feed back. Feedback that you could have taken part in. People kept acting like they weren't adopting python3 until the core devs did some thing about backwards compatibility but that was no where on their radar. Python 2.7 is no different than python 3.1, 3.2, etc, they are all dead.

Well' 2.7 is quite different in that hundreds of millions of lines of code, and huge production systems, will remain in that for the next 10 years at least.

The author is sufficiently obnoxious and abrasive at numerous people that I wouldn't be at all surprised at developers attempting to steer prospective future community members elsewhere, though for far more appropriate reasons.

I saw a presentation by him a few years ago[1] and I think the best characterization I could come up with is "Nobel Disease". He doesn't literally have a Nobel, but I think his early success has gone to his head and he seems to imagine himself an expert[2] on things that he is manifestly not.

[1] On a subject that I could reasonably be called an expert on. No, I will not elaborate for reasons of pseudonymity. Take that for what it's worth.

[2] As if we even had objective criteria for judging language design at this point in time.

I think it's less than he said that Python 3 sucks, and more that he had a completely incorrect and misleading explanation of how Python 3 is not Turing complete and thus nobody should use it over Python 2. Then when he was hit the Internet backdraft, he pretended that it was an elaborate joke instead of evidence of his massive incompetence.

Is it even possible for any non-trivial programming language to not be Turing-complete?

I think the answer is "No", but it depends on where you draw the line at "trivial" and "programming language." I think ANSI SQL isn't Turing complete. But I don't consider that a programming language. I think all modern general purpose programming languages are Turing complete.

That is, programs from general purpose programming languages can be re-written in any other Turing complete language. Not to be confused with the Zed Shaw "joke" that a programming language is not Turing complete if its interpreter does not run source code written in another Turing complete language, completely unmodified.

> If this is true, the Python Software Foundation should be ashamed.

With Zed can come... drama. At least that's the way it used to be. I would take what he says with a grain of salt.

Nothing ever changes. Every time I see his name appear, there's yet some more absurd drama involved.

"Saying that Python 3 sucks" is putting it a bit lightly. He openly advocates against using Python 3 [0](related article [1]), which is obviously something the PSF doesn't like to see.

To be honest, I am a bit surprised that he adapted the book to Python 3 if he is so strongly against it.

[0]: https://web.archive.org/web/20161123042252/https://learnpyth...

[1]: https://eev.ee/blog/2016/11/23/a-rebuttal-for-python-3/

Well, first he said he wasn't going to, then he got flamed by basically everyone on the Internet over it, then after that publicity died down he changed his mind and revised it.

A cynic would think that his criticism was an elaborate marketing ploy to drive up sales of the eventual Python 3 edition of the book which he had planned all along...

Then I recently found out that members of the Python Software Foundation (PSF) have been actively trying

Something worth knowing about the PSF is that there are multiple groups to which this term might (correctly or incorrectly) be applied by someone who wasn't familiar with its workings.

Most importantly, literally anyone on earth can become a "member" (in the technical bylaws-of-the-foundation sense) for free by filling out an online form.

The question here is whether someone who is legally authorized to represent and act on behalf of the PSF did something in their capacity as a representative/official of the PSF. Which really is something only the Board of Directors, or someone they designate, can do. The records of the Board's meetings and actions are public:


So if you want to verify this claim it ought to be easy to find in there.

(disclaimer: I am a Fellow of the PSF, which is a sort of permanent voting member, but not board membership. I am on the Board of Directors of the Django Software Foundation, though, so I have some experience with how actions can be misinterpreted or misrepresented...)

Re: PSF: Agreed. The good news is that the author will be compensated for this work. Sadly it makes me, personally, regret my time investment and trust in python.

@jachee there were many issues with LPTHW, despite its cool branding. Here's a list compiled by some who had to repeatedly walk people who used it through the many problems it introduced to their learning process: https://sopython.com/wiki/LPTHW_Complaints

I hope you carry on with Python!

I'm curious what proof the author has about this. Is there actual proof that the PSF is trying to undermine his work?

It's nice to see Zed on board with Python 3 - I know he has been a strong advocate against it for a long time but it would be really silly for people to hold that against Zed or his books into the future.

Zed Shaw educates ALOT of beginners about Python. Everyone should be both glad and supportive that his education is now in the Python 3 world.

Time for everyone to leave the angst of Python 2 behind.

I can no longer think of any prominent industry figure who stands openly against Python 3. With no well known industry figures standing openly against Python 3, I think the long and painful transition can now be said to be complete. Finished. Certainly much Python 2 code still exists but conceptually Python 2 is now legacy.

Thanks to Zed for his work on the Python 3 book.

I started with LPTHW. Like literally did not know what a string was started. I remember the part of the book recommending to use 2 until 3 was as complete. I remember not caring either way.

Beginners do not care about Python versions. They're trying to figure out why their string won't print, running into bugs like: 'I'm printing a string' and being _stumped_. These people are not going to be contributing to Python3 migration, they're just not there yet.

And if people are running production grade applications are listening to Zed? Well, good luck to 'em.

> I know he has been a strong advocate against it for a long time but it would be really silly for people to hold that against Zed or his books into the future.

Opinions are opinions. This isn't about opinions; it's about behavior.

>Zed Shaw educates ALOT of beginners about Python. Everyone should be both glad and supportive that his education is now in the Python 3 world.

That entirely depends on the quality of the instruction.

Last time this came around, he was willfully misrepresenting the difference between "str" and "bytes" specifically to gripe about how used to python 2's broken implementation he was. That's not helping.

> Before my books there was this general belief in computing that only “special” people could learn to code, and that it was pointless to teach anyone who didn’t start when they were 12.

AFAICT, this is not only not all that true (teaching adults to code, and the belief that they could be successful, was not a novel when LPTHW was introduced, though some people certainly thought the way Shaw describes; I mean, schools have been taking people without programming backgrounds as CS majors forever, and there have been adult-targeted self-learning introductory resources, books and otherwise, for programming continuously since the 1980s, probably earlier), but LPTHW has not been associated with any substantial change in general attitudes on this point. While it wasn't then and isn't now then general attitude, people still—and AFAICT in roughly similar proportions—buy into the idea of the “from childhood” coder being inherently superior.

Its downright delusional to believe that he in anyway is somehow responsible for a sea change in cs/programming education. I read that blog post eyes wide jaw slack. Moreover, I'm curious where he came up with the millions of users who "learned" via his books?

Learn Python the Hard Way was one of the first ways I tried to learn programming. It didn't end up working for me. It focuses on repetition rather than a conceptual understanding of what you're doing. But when I finally took a class and realized what I had been doing with all that practice I came to really appreciate how comprehensive it is. I won't use it myself, but I'm glad that something like Learn Python the Hard Way exists

I had the same experience, and thought it was the opposite of what the title implied. Rather than being more work up front for much easier progress, it seemed like a lot of easy typing things you don't understand and therefore making slow progress.

However, I generally prefer learning concepts first, with practical application later, so it could have just been a personal preference.

> Starting July 8th, 2017 both my Python 2 and Python 3 books will be no longer free to read.

Now who's being petty? Sounds like you are retconning in a story about exclusively-commercial-book-titles-bring-maximum-community-benefit.

O'Reilly and other publishers have offered paper editions of freely-distributable books.

God forbid anybody on the internet has his own opinions AND writes them in a non-corporate strong/humorous language.

And God forbid anybody calls the Python 2 to 3 transition (which took 7 years and is still underway -- not even 50% done) for the actual mess it has been.

> actual mess

Doesn't seem that bad to me. Py3k was released and folks waited for the hobbyists to iron out the quirks. A few years later the libraries started supporting it. A few years later the forward-thinking companies have started switching. That's a normal software upgrade timeline. Heck, the other day I found out a new client is still running Windows 97.

> I realized that I’m now sending beginners into a community that actively ostracizes and punishes anyone who dissents against the decisions of the PSF members. I simply can’t support the PSF anymore given these actions, and I can’t send them new people if this is how they treat anyone disagreeing with them.

> At that point the decision became much clearer. If I charge for my Python books I can help even more people and also give people real jobs working for me.

He doesn't want to "send" any more people into the community, so he now charges for his books.

What exactly is the connection there? How does charging for the books change anything? Does he assume charging for them sends less people to the community than before? If that's his goal, why doesn't he stop publishing his books completely?

Awesome! LPTHW is my go to recommendation for introducing folks to programming and Python.

Also I really like his abrasive opinion writing style. It's very effective at getting people talking even if it is rather crude.

This guy has such an ego problem. I'd hope that the PSF would actively ask people to stop linking to learn python the hard way, when it's teaching a version of the language that's over ten years old (and it's far from the only resource). The book has the benefit of having a catchy name that people can easily recommend, but that's about it. This guy really needs to get off his high horse, I'm even considering writing my own book just to compete with him.

I've recommended LPTHW before. I actually liked Zed's tone. It's nice to see a technical opinion when you're learning things so you pick up best practices or at least see justifications so you know how to form your own.

But seeing Zed's acerbity applied to a non-technical narrative makes it all just seems petty and toxic. I'm not going to wait for this to "play out" as some suggest. He's embedding this anti-establishment dribble into an introductory learning text, as he did for the first and I'm fed up of meeting developers who parrot his flawed feelings on the inadequacies of Python 3.

He says he's helped 12 million people with LPTHWv2... but in this day and age, taking a idealistic stand against Python 3 makes you a worse developer and would certainly count against you I were interviewing you. Professionally speaking, there's just too much to be had from Python 3.5+ to avoid it.

I won't recommend LPTHW again.

You should start a patron page. I feel that a significant number of people would be willing to support the work you do, and this would allow you to both keep your education free while earning from it.

Just my two cents.

I have multiple years of experience writing production Python code - is this book for me(new to 3)? Or is it more generally aimed at new programmers. Cheers!

Because I don't think I can edit posts yet, this blog post of the author's is very useful in gauging where the books assume their readers are at:



> When I was working on Learn Python The Hard Way I was frustrated by how often I’d have to explain that the book is for a total beginner.


> What I propose is we have beginning coders and early coders. I got this idea from a painting teacher who kept referring to students who had never painted as “beginners”, but those who had painted for about one class as “early”. The reasoning is that you need a way to differentiate people who don’t know a damn thing vs. people who know the basics but just simply suck at them. Teaching a beginner is very different from teaching someone who’s already been doing it for a bit and just needs more training.

> For example, a beginning coder doesn’t know how to type the | (pipe) character. They don’t even know it’s called a “pipe”. I’m not joking about this. Professionals actually don’t believe me when I tell them this, but it’s true. Beginners have zero experience so simple things like making a text file, opening terminal, and even the idea that you can type words at a computer and it will do stuff, are simply unknown to them. To teach a beginner effectively requires this level of information slowly fed to them in reasonable chunks.

It's for people learning how to program for the very first time, to the point they need to be told to enter code into a text editor as opposed to, say, Microsoft Word. Or whatever Microsoft is calling its Word Processing Software Tool Universe For Non-Programmers this week.

(Yes, it might well be possible to coerce Microsoft Word into emitting plain text. The book does not assume its readers know that.)

From what I recall, the author is very opinionated in that he does things one way and expects readers to follow along exactly. The readership is at a level where this is a good thing: If you introduce options, people who know absolutely nothing get paralyzed by them, because they have no basis for making those kinds of decisions yet. It would be better if they flipped a coin, most likely, but most people seem reluctant to do that, because utter beginners are irrationally afraid of damaging things.

So the author has made all the decisions for them, and can get them to the point where they know enough to disagree.

I learned python 2 by reading an earlier version of the book. I already knew how to program in general (20+ years experience), and the book was a little basic. Still, as an intro to a language (I was new to python entirely) it was worthwhile. I also like the author's writing style.

I was going to say that they're free (or pay what you want), but that's apparently no longer the case (or won't be as of tomorrow). I support the author in this decision, but I guess you have 12 hours to skim the book and see if it's worthwhile and then buy it if you like what you see.

You will not gain anything from it.

It's for people who can't code

The Python Language Reference is pretty good if you're already experienced: https://docs.python.org/3.6/reference/index.html

In your case I would recommend Effective Python and/or Fluent Python if you haven't read those.

Fluent Python is a great book. I found Luciano Ramalho's writing style very easy to follow and his knowledge of Python is extensive.

Looks like Effective Python should be next on my reading list!

Love how everyone's getting themselves butthurt about Zed's opinion on a language. We all hated python3 at one point.

I did not. I started with Python 2 around 2009 (coming from a C and Perl background) and was surprised how backward string formatting is, and how unicode is messed up.

Then I started with Python 3 and was relieved to find named .format() parameters and bytes (vs. str). This is just an example - Python 3 is a very positive evolution.

(and yes, I read the arguments of the other (mistaken :)) group who advocates Python 2)

In that particular article, there were a lot of "alternative facts" (basically a lot of things that were simply not True), written in a subjective, aggressive manner. That's why it was bashed not because "somebody did not like him".

Zed, you deserve to get paid for the work you are doing, and I appreciate that you've given it way for so long. Just be up front about it, don't bring the PSF into this.

Just own it. That said, I wish you had given more notice than a day.

Agreed. Wanting to get money is fine, wanting to get money out of something that was (mostly) free for the longest is sort of contemptible but he's in his right to do so. However, I've never liked much at all his attitude towards the PSF, and these so-called demands from them reek of bullshit.

Can anybody explain to me why, every time Zed Shaw writes something, flamewars emerge? Even here on HN which is one of the most courteous comment sites on the web I know off, has so many deriding comments within in minutes.

> Can anybody explain to me why, every time Zed Shaw writes something, flamewars emerge?

Because Zed Shaw often writes things that are both (deliberately, AFAICT) inflammatory and about something which has a large interested community.

Zed Shaw used his public position to say that Python core developers were of low character and competency. When reading this article, I don't see how his position has changed.

I couldn't imagine the cognitive dissonance he faced while working on this updated volume. He may have found some comfort in using Foo and Bar, though.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact