back
160 comments
A nice quote from the last chapter:

Programming as a profession is only moderately interesting. It can be a good job, but if you want to make about the same money and be happier you could actually just go run a fast food joint. You are much better off using code as your secret weapon in another profession.

Well said, Zed. Very well said indeed.

I have to agree. The act of executing someone else's ideas with code is mundane and borderline annoying. It's the other things, the design and development that really gets your brain churning -- its also what gives you more value.
You are much better off using code as your secret weapon in another profession

In what fields is this true? What is the metric of "better off?" More money? More "respect?"

Bullshit. You can make gobs of money as a contract developer with very little risk.
This is very true -- if you're bad at it.
From the final chapter:

"Programming as a profession is only moderately interesting... You are much better off using code as your secret weapon in another profession.

People who can code in the world of technology companies are a dime a dozen and get no respect. People who can code in biology, medicine, government, sociology, physics, history, and mathematics are respected and can do amazing things to advance those disciplines."

Don't know about the programming profession, but the secret weapon bit is true to a degree that might shock many of the readers here. I would even go so far as to say that NOT knowing how to program causes ridiculous waste of resources in other disciplines.

Working as an epidemiologist during the H1N1 pandemic, I saw literally dozens of man hours drained on repetitive statistical reporting and database tasks that the average reader here could probably automate in under an hour. There were lots of extremely smart people running around with a ton of important things to do, but since no one (myself included) really knew how to program, what were we to do? I think I was the only one to even have the inkling that we could probably be replaced by a few Excel macros.

I don't know this guy's back-story (or why he seems to inspire such antipathy), but this passage got me very excited! I'd already bought into the idea that learning at least the basics of programming would be a good way to improve my general analytic thinking ability (a noble goal, IMHO), but I was being held back by the thought that it was a bit of a frivolous endeavor. This has really inspired me to get started!

Secret weapon indeed! Wooo!

[EDIT: I see several others have commented on this bit. Sorry to be repetitive!]

Yep, that's the idea. Writing a book for programmers isn't really that useful. There's plenty of those and adding one more programmer to the tech scene would be like spitting into the Pacific.

But, if I can improve every other discipline by making it easier for them to learn to code, and then get them to use code to improve things, then that's a much better goal.

How would I get into one of those fields? I would love to be involved in some scientific research or some medical project. I have a solid and wide-ranging tech background, but I've only ever had luck working for tech companies and wouldn't know where to start otherwise.
As a teacher I can attest that it's impossible to find decent programming "text books" for Python, PHP, etc for classroom work. Most of the books you see on the bookshelves at Great Big Book Chain may be great books for programming language autodidacts, but they don't get adopted in courses because they universally lack relevant exercises for newbie students.

As a result, instructor's have to create all of the questions and exercises for the course---he/she might as well work without a book. At MIT, the Intro to Programming Course (using Python), doesn't have a textbook because, say the instructors, there are no good textbooks for Python. If Zed can come up with well-paced and instructive questions (Little Schemer-style), he's got a winner.

BTW, If you plan to contribute questions to Zed's book, try to put yourself into a newbie state of total ignorant bliss. Remember that the ideas you take for granted and think of as "simple" are completely daunting to beginners. Pacing is everything.

Sometimes I'm not sure if Zed is a prima donna or just misunderstood. But, one thing is for certain. Zed definitely contributes to his respective communities. He contributes a lot. Probably more than most of us ever will.

Thank you Zed for your hard work and contributions.

I prefer Diva. It implies I have skill. :-)
If Zed started off life as a slightly loose cannon coding rock star, I believe we've seen him evolve into something much more important with greater staying power. Here's hoping he stays excited and engaged in the Python community.
I was never a coding rock star. That's an image other projected on me along with "he's a Ruby guy", "he's a Python guy", "he only codes scripting languages", and many other bizarre myths.

But hey, like David Lee Roth said, "Who am I to fuck up a good myth?"

Holy... The output of this guy is as awesome as it is diverse. Way to go, Zed.
I said this on Twitter directly to Zed, but it bears mentioning here. This is a sweet introduction to both programming and Python. I started playing with Python a couple weeks ago and wrote a few small applications. One of my pythonista friends looked over my code and noted that I could have used string formatting instead of concatenating everything. None of the books and tutorials I'd skimmed mentioned the print formatting but this book explained it perfectly. Best of all, its succinct.

I'm sure there will be a ton of new exercises added to the book, and more topics to come, but this is a great start. Thanks Zed!

Glad it's working for you. As I work on the book, let me know if any exercise isn't making sense. Many times if that's happening there's something you're missing I need to include.
Be sure to read the end.
The message at the end is quite good. It is the same message he gave at the http://blog.cusec.net/2009/01/05/zed-shaw-the-acl-is-dead-cu... talk. I discovered Zed through the rant against Ruby's community (I had done a google search about ruby disadvantages or something like that and his post came up). He's grown up quite a bit.
Still very incomplete. Goes from exercise 10 (by which point they've not done if statements) to exercise 27 (where they start learning about AND OR etc.

Tone/diction/sentence structure is a bit patronizing. I think Shaw was going for more basic than is required for most intelligent adults.

Yep, still a work in progress. Ex 27 is where they switch to learning logic, so I laid a marker there to work toward.

It's not really patronizing so much as "gentle" to non-programmers. I do however poke fun at programmers because non-programmers have some odd beliefs about coders being these gods that they aren't. By cracking little jokes are programmers I'm hoping to get them over this fear.

It seemed more geared towards kids to me. It seems like an attempt to bring back the way a lot of us learned, by buying books/magazines with code listings and typing them in. It's a decent idea. Anyone can do it and you really do learn something about writing code. Sadly, we stopped doing this when books started to come with disks. And then the internet... There is much less satisfaction with looking at source that is already typed and running it.

As an aside, I like that Zed is very opinionated.

Have you never worked with someone and had the thought go through your head, "Sure, this person's intelligent... but can they write code?"

I'm not sure this book is a solution to that problem, but it certainly has a strong opinion.

The output of Zed Shaw is unbelievable in terms of stuff he actually gets done and delivers. Maybe he should deliver a few GTD seminars :)
He'd just yell at you until you left the room and started doing something else.
if zed is indeed the anti-why, this will be his non-poignant guide
Zed's soothing guide to Python?
Interesting captcha system on the login page: http://learnpythonthehardway.com/login
The restrictions on proposed exercises seem a bit extreme: http://learnpythonthehardway.com/wiki?name=Proposed+Exercise...

If a beginner can't learn OOP or use projects that span multiple files, are they really ready to learn Python the hard way?

Plus, I would disagree with the definition of "complex math". My college discrete math teacher (who was from Mexico) said that he learned everything he was teaching us in elementary school, so I don't think that just because you learned some math in college necessarily makes it complex.

How is this better than python docs again? Seriously. It's not for beginners, it's not for intermediate, it's not for advanced users in its current form.

I remember when I was a kid (cue during the war...) we had to type in sheets of paper in order to play games, learned through modifying them, experimenting like in a sandbox. I don't remember if I saw something similar in the past 15 years or so. It doesn't even have to be a book, it would work as a sandbox type of environment. I think I saw one based on scheme, but I can't remember the name right now.

I have a younger cousin in high school right now who's just starting to show some interest in an engineering career. It could be interesting to try to use this to teach her to program. Tempted to try over the summer and then blog about it. I think she's thinking either computer science or electrical engineering, might be a good way to sway her over to my viewpoint from my father's...
Whoa, that was quick.
I've never heard of fossil before. There's a lot of noise around Git and Mercurial these days (I just recently transitioned to Mercurial from SVN), but fossil sounds like an interesting concept - and indeed, once I've got an SCM, the next thing I go looking for is some kind of bug tracking system to integrate it with. Nice!
If a programmer tells you to use vim or emacs tell them no.
This is awesome. I love this guy, really. Zed, I'm interested in knowing how did you evolve as a programmer? Do you've a degree in Computer Science? If no, how did you go about learning all the stuff that you know today? Totally OK, if you choose not to answer this one ;)

Non-native speaker, so sorry for bad English.

This is awesome, Zed. I would have loved this five years ago, the first time I tried (unsuccessfully) to teach myself programming. I actually tried to learn with emacs and SICP because I took advice from the "wrong" people.

The second time I tried to learn programming it was a lot easier because I was in grad school and had people to help me. If you don't have people to help you, then existing materials are very hard to learn from. This book seems perfect for solving that problem.

This looks like a good start for what may become a great resource. Like others have noted, the ending is well worth reading, pity it had to arise from such vitriol.
I like the idea of this -- any chance for a Ruby spin-off?
I know Zed was just reacting to dive into python, but if I seriously wanted to help people learning to program I wouldn't write a pdf, I'd make a fun interactive website.

The first think Zed asks his readers to do is find the terminal and get a python command prompt up un going. arrg..

The first thing a new programmer should do is something cool and interesting, or useful. Immediate gratification.

10 PRINT "Jay Rocks" 20 GOTO 10

This is wonderful. I've "been thinking" forever about trying to write a book to teach children (in particular) how to program in python. But among other problems, I had never come up with an approach that made sense. (That is, one that didn't start with something stupid like "data types".)

So, I really like the approach here, and I really like the tone.

I've just started showing my nine-year-old son how to do simple printing and math in Python (basically Chapters 2 and 3 in LPTHW), and he is pretty stoked about it. This will be a great addition.

Not to overburden the discussion regarding the last chapter, but I have to agree with the very last line: "You can code. They cannot. That is pretty damn cool."

That was an interesting read. I think Zed has very nicely anticipated many questions a novice programmer might ask while avoiding the trap of trying to spare them the grunt work required to understand the basic concepts a programmer requires.
Thank you zedshaw for doing this. I do hope this will make it to the HN "evergreen" page (if pg ever makes one). It seems like every now and then someone asks how to get started with coding and well now they can.
I like it a lot so far - a very nice start to a book that is very different from the typical beginner book (in a good way).
The <title> element reflects the current page, which is a nice improvement over his other new sites <g>.
Maybe the case is not that programming became less interesting, but that there are too many (mediocre) programmers.
on a related note, has anyone read through Thinking in Python?