Learn Python The Hard Way: a new book by Zed Shaw
learnpythonthehardway.com
learnpythonthehardway.com
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.
Instead of reading it as discouragement to become good at programming, I'd read it as encouragement that it can be used in the other things you are interested in. You don't have to be "a programmer". It's an important point.
He showed me I think more than 20 prints of web apps that he had visited, and on each one he sometimes typed his login, sometimes searched for a number, other times the name of the person, other with his state of residence. He could have reduced his typing to just one.
Also, if you don't believe this particular anecdote, I have dozens more. I've built web apps for law offices during 4 years. And when I left the company the TODO list for what I was working on was still huge. Absurdly huge. Software is never done.
Programming manages information and reduces repetitive computer tasks, and lots of professionals have this problem.
Now, should the owner of a fast food restaurant learn to code? Maybe not. Should he hire someone that knows how to code? Maybe not. Should he buy somekind of software to manage his operations? For sure.
But it's the same necessity: There's a problem, you can either solve it yourself or pay someone else to do it. And the problem is managing information and time.
Sheesh, don't you know anything?
If you cared to hear my explanation, I'd tell you. (it involves a burrito...)
"I'm not a [programm]er, I'm just [programm]ing!"
Programmers know a whole lot about... programming. Some people therefore write development tools, IDEs, text editors, compilers, operating systems, and databases. This seems to me a relatively small niche, though. Commercial development tools often live and die by free and open-source competition.
Otherwise, without actual domain knowledge, a programmer becomes a tool for people who do possess this knowledge. Typical programming jobs suck because they boil down to pushing data from point A to point B, while transforming it in a way specified by someone else. For example, in the financial industry, a non-quant programmer is just a cog. Possibly a highly intelligent and competent cog, but still never the person who designed the underlying process. On the other hand, a quant with programming ability actually has a chance to do something original. Even traditional "computer sciencey" work is rarely just about programming. Computational biology, computational geometry, robotics — those are real fields, where programming helps solve problems.
In what fields is this true? What is the metric of "better off?" More money? More "respect?"
Examples I've seen are people in marketing departments who can write a little python script and suddenly analyze hundreds of thousands of data points. Or someone who combines thousands of geo-targeted data points to better decide where to open chain x's new store.
Traditional companies are structured so that there's a "marketing" team and a "business intelligence" team of dba's-cum-statisticians. 90% of the time, if the marketing person doesn't ask the perfect question, they don't get a useful answer - and the BI person is on to their next task.
The coder can both ask the question, generate the data and then iterate based on the results of the output. Hugely powerful and can't be done by 90-95% of people in most companies.
I saw another website once -- e-commerce in a niche y'all are uninterested in -- where, among numerous other problems, someone was about three lines of PHP away from adding six figures of revenue to the business, because the person who set up the website thought that title tags had to be the same sitewide because they didn't have time to rewrite each of the XY,000 pages individually.
And better off would either be more free time, more money or more status (however you define that). Pick one.
Saying that, if I could install anything more pleasant than VBA I'd probably be happy.
I guess, in other words, our "day to day work" is "helping out with any trivial task someone would like to automate", though I personally wouldn't phrase it that way :)
Deploying software written in Matlab that other people can use is a nightmare.
Biology: You can catalog and simplify your workflow by breaking things up and correctly keeping them all organized while doing things the fast way.
Author: You create smart searches, web spiders, pattern recognition (to capture your repetitive sections) and you learn formatting. Additionally, the text editor skills are very nice for some types of writing.
Automotive/Racing: Calculating gear ratios? Analyzing race data? Optimizing pit stops? Not everyone is a formula one racer.
Small Businesses: Automated Scheduling of Clerks/floorpeople, inventory managment, loss detection.
Fashion: Modeling (no pun intended) cloth usage by shape cuts, number of seams required, etc.
Notice how weird that is? If you like programming, why are you doing something else? If you don't, why would you add programming to your duties as a race car driver? OK, if you really love both, do both.
Otherwise, you're just wasting time that you should be working on your actual job by piddling around in related programming projects. You're probably being mediocre at both instead of good at one.
It's not weird to like more than one thing. It's also not weird to look at all of the areas you enjoy working in and make a combination of them work. This is what allows us to make a unique contribution.
Because if you know even a little, it goes a long ways in other fields. And honestly, a huge number of programming jobs SUCK. I mean, it's a field specifically excepted from overtime laws!
>why would you add programming to your duties as a race car driver?
Because you want to race better? And it's not the driver who I know who does this (it's actually motorcycle racing), but instead some of the pit crew who does. Even hooked up a neato GPS thing for the racer.
>Otherwise, you're just wasting time that you should be working on your actual job by piddling around in related programming projects
Spoken like someone who's never worked outside of software development. If your job is "select the 10 best properties to turn over", you job could very well include "write software to help do that". If your job is "Make sure this data is sane", you can most likely write some software to help the process along, decrease repetition, and otherwise make you look awesome.
Teacher: create randomized, self-grading quizzes from a test bank of question templates; optimize the dickens out of your grading work flow; check for cheating on assignments
More respect - oh yes.
More money - we think so. The early signs are good.
More low hanging fruit in terms of satisfaction or directly helping your users improve their life - most definitely!
BTW, " if you want to make about the same money and be happier you could actually just go run a fast food joint." is certainly not true in my case, and I suspect in many cases.
I do think "You are much better off using code as your secret weapon in another profession." has a lot of truth to it, although again, it depends on the individual.
Money is really just a form of freedom. If people are free to do what they want, they will be happy; if not, they will be miserable.
"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!]
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.
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.
Thank you Zed for your hard work and contributions.
But hey, like David Lee Roth said, "Who am I to fuck up a good myth?"
Watching your vim-fu at the first RoR conf (which I don't expect you to remember,) I still long for a series of vim screencasts from you, going into things like custom vim scripts and how you integrate it into your workflow.
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!
I'm following this book with a great deal of interest and plan on working through it completely. I'll let you know if I get any hangups.
Tone/diction/sentence structure is a bit patronizing. I think Shaw was going for more basic than is required for most intelligent adults.
I'm not sure this book is a solution to that problem, but it certainly has a strong opinion.
I think a much more reasonable analogy is something like playing the harp. Most people see little point in learning, and many of those that try it won't have the aptitude/interest to actually become adept, but there are a few that will become masters.
They already are programmers. They just don't know it yet
As an aside, I like that Zed is very opinionated.
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.
The patronizing part wasn't the non-programmer part and making fun of programmers. I actually loved the line about VI/Emacs. It was the overly simplified sentences. Let me dig the pdf out:
You can print things out with print and you can do math. The next step is to learn about variables. In programming a variable is nothing more than a name for something so you can use the name rather than the something as you code. Programmers use these variable names to make their code read more like English, and because programmers have a lousy ability to remember things. If they didn’t use good names for things in their software they’d get lost when they came back and tried to read their code again.
For instance in this section your actual sentences are very simple. Over and over you use these simple sentences. And you use an explicit "you". It gives the feel of a children's book (I don't know if you have kids, but if not, google for some of the books or ask a co-worker to borrow some). I think explicit "you" is fine, but the constant reassurance compounded with the sentence structure and explicit "you" feels patronizing.
Other examples:
You might not know it, but every time you put " (double-quotes) around a piece of text you’ve been making a string.
Most of these concepts will be exciting once you get them. You’ll struggle with them, like wrestling a squid, then one day snap you’ll understand it.
I know several people professionally who'd benefit from the book if you upped the "implicit respect" of the style a few notches. However, I'd be afraid to give it to a few of them out of fear of insulting them with the way some people will interpret the tone. I'm putting this out there in all earnestness.
Here are a couple books on two different styles which might be more applicable for the work. They are on actual explicit styles of writing, although the second pretends all writing should look like that.
Clear and Simple as the Truth by Thomas & Turner (Classic style).
Nonafflink: http://www.amazon.com/Clear-Simple-As-Truth-Writing/dp/06910...
Example of classic style:
When I was a boy, there was but one permanent ambition among my comrades in our village footnote [1. Hannibal, Missouri] on the west bank of the Mississippi River. That was, to be a steamboatman. We had transient ambitions of other sorts, but they were only transient. When a circus came and went, it left us all burning to become clowns; .... now and then we had a hope that if we lived and were good, God would permit us to be pirates. These ambitions faded out, each in its turn; but the ambition to be a steamboatman always remained. --Mark Twain
Style by Williams (Plain Style):
Nonafflink: http://www.amazon.com/Style-Clarity-Chicago-Writing-Publishi...
Example: After Peter the Great died, seven out of eight reigns of the Romanov line were plagued by turmoil over disputed succession to the throne. -- Williams edit to uncredited work on Russia
Another way to put that is the complexity/simplicity of the prose attempts to match the complexity/simplicity of the exercise.
I'm worried about people I might recommend it to (and thereby seem patronizing myself). With the current style, I'd probably only recommend it to kids and a couple adults I know very very well.
Encouragement and assuming the user only knows what you have told them (which you do in a few places) are the things that don't come off as "adult literature". Hell, a couple teens I know would feel patronized by that, and teens definitely take themselves seriously. The short sentence structure is only the biggest of deal because of the other two facets. You could keep your grade 6 FKA score but ditch the other two parts of the style.
As the tone is now, I'm pretty sure they'd take me handing this to them worse than a X for dummies book.
Not that the book is worth derision, just as a tactic for those who take themselves too seriously.
I know Zed's history. I'm not going to have issues using the book. But random non-programmers don't. And those are the people I'd hand the book to. I've got a thicker skin than some of them, and wouldn't care about the tone of the tome even if he directly insulted me. But THEY would. That's the issue.
i.e. When you hand it to them, say, "the language is overly simple and patronizing, but his approach is a good way to learn." Then your (apparently) big-ego friends can mantain their air of superiority while reading the book, without being insulted.
Not that I agree that his language needs to be changed; on the contrary I think is is great. I would have loved such a gentle introduction, at any age.
They're certain people at companies I know and work with professionally who ask me "Hey gte910h, what's a great way to learn programming".
I'm known as respectful yet blunt. If I handed this to someone, they'd wonder if I was saying they came off as retarded or that I had no respect for them (or programming is much harder than it is for the type of tasks they want to do).
For people who work in relationship based businesses (many non-programming businesses are), what others think about you is very important. The idea I thought them incompetent would be a very bad thing.
Some of the people I'd hand a book that went through the typing approach without the coddling part would hear the book loud and clear and possibly not remember the message I could use to hand them the book: "Hey, this guy who tends to be a bit insulting to people in some of his writing wrote a book on programming. He acts like you're a dull 11 year old throughout the book. But hey, his method is good".
These aren't people with big egos, but I'd sure as come off as having one about my profession if I tossed this at them. Especially if they handed it off to a third person who I never met but had heard of me.
I'd just be more respectful and less helpful and not ever mention the problematic resource. It's not worth the risk I'd lose a client over it.
>You aren't listening. He said to, "deride the language" and "praise the approach" to those you give the book to.
It wasn't clear to me the poster was talking about those you give the book to. It just sounded to me like he wanted me to give props to Shaw for his approach while saying he wrote in a manner some would take offense to.
As to Zed Shaw, I think I've honestly put in more work on the book already than 99% of the people who love it unconditionally have. I've read it in it's entirety and given suggested changes. Editors and critics are very useful when writing books.
He doesn't need to change the style. If he changes the style, he can market it as a book for adults and children. If he keeps the style the same, he should market it as a book for 12 year olds. Then, when someone hands a copy, it says right there on the cover "Yo, this is for kids" and no one get's insulted as you can reveal "Hey, this is really good, in spite being for 12 year olds".
s/term/tend/
s/is/his/http://www.fossil-scm.org/index.html/doc/tip/www/index.wiki
P.S. I assume that is the Fossil in question
It's only there to keep bots out. It's not all that secure.
document.getElementById('p').value='5544e312'
This isn't going to stop anyone who knows urllib.
Seriously though, I'm going for simple and if there's a problem then I'll lock it down more completely.
import urllib2;urllib2.urlopen("http://learnpythonthehardway.com/login).read()
Since you only want basic protection, you could avoid the visual captcha all together and have the "Fill out captcha" button auto-submit.
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.
And if you think about it, there's no point in learning OOP before you've even learned basic logic, functions, and I/O. That's what I learned first (because there was no OOP when I was learning).
Finally, your professor and you are not who this book is meant for. The simple fact you think discrete math is alright for anyone but a CS major is proof of that. Not to be mean, but it is.
Fair enough, but that doesn't make me wrong. There is a valid case to be made for teaching discrete math to people who aren't CS majors or even in college: http://www.artofproblemsolving.com/Resources/articles.php?pa...
In particular, the argument that discrete math is fun is the most compelling. Be honest, what did you enjoy the most: algebra, calculus, or discrete math? I'd argue that if you say algebra or calculus that you're the abnormal one. :-)
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.
But, to be honest I also had some original aptitude, so I got lucky that this worked out for me. Expecting other people to just "type in a load of code" probably won't work the same.
Like you, I didn't learn logic and control structures to print out tables of numbers, I learned it so I could make an object move on the screen and to draw pretty pictures. I learned all the print capabilities to make a pretty looking layout on the screen and to get some random information "just so".
The reason I say this is that I like the idea behind this text, a lot, for people who want to learn from nothing, but I don't think it will hold people's interest for that long. I keep wondering if they'll just burn out if you're doing nothing but printing out the textual results of logic puzzles.
I'm not asking for a video game, in fact, I'm not sure exactly what I'm asking for, but there's got to be a way to light a fire in someone's head the same way it lit in mine when I typed in "line 32,32 to 32,64" from the BASIC manual and a red line appeared on the screen... and I realized I could do anything on that screen with the right sequence of commands... anything.
(Well, I found out otherwise later... but that's how it felt)
(And yeah, I realize getting graphics set up in python sucks for rank beginners... part of the reason I'm not sure exactly what should be done...)
I still remember C64 and I typed in (I still remember it):
POKE 53280,0 : POKE 53281,0
and voila, black 1337 haxor screen like "big" computers had! Then curiosity kicked in and I learned what POKE was and what it does and what are those addresses etc.
Also one vital thing about my specific path is that I asked for a computer (my first one was ZX-80) when I read about some computer game (I think it was called valhalla or something) where there was this whole world you could explore and my first reaction was not "cool I'd like to explore it" but was more like "cool I can make my own world with this computer thing"!
http://nodebox.net/code/index.php/Home
if you don't care about python, processing is a great way to teach programming with instant graphic feedback and is cross platform.
I just think that until there's a solid totally idiot proof way to do "write, run, fix" and get graphics you'll fail at this. It's this patter of writing out a file, running it, and fixing it that's missing really.
But, I also think making things fun for people is overrated. Too often we think that in order to teach we have to entertain. Problem is that makes people (kids and adults) who can't learn anything hard. Hard problems are not entertaining. They may be satisfying, but until you've slogged through solving a bunch of them they aren't really entertaining.
Anyway, I just don't think graphics and entertainment is where it's at. Making it possible to accomplish the exercises and feel like you learned something that gets you ready for fun and graphics is all I'm aiming for.
Fair enough about the rest.
I sort of wish I could look at the innards of that manual again to see how they structured it...
[1] http://www.amazon.com/Getting-Started-Extended-Color-Basic/d...
Non-native speaker, so sorry for bad English.
Other than that, I don't drink, so that gives me lots of extra money and free time. Like I just bought another guitar. Woot! G&L Comanche. Can't wait.
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.
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
However, the #1 problem all the people I've tested this on have is getting basic gear going. The simple act of just "write, run, fix" is even daunting. The goal of this section is to give them a very simple set of things to do so they can get to just enough working gear to do write, run, fix.
That "immediate gratification" just doesn't exist anymore. It existed for BASIC because Microsoft included it for free for years, so no install needed. These days there just isn't something like that out there.
The only exception to this would be a Javascript book. But, javascript is such a giant nasty mess it would be hard to teach things like this. Without good error messages, syntax errors, etc. it'd be pointless to teach it.
If I could find some time to fix up Shoes and then Hackety, there would be. It's hard when you can't get the library you're building on to compile...
So, I really like the approach here, and I really like the tone.
Full disclosure, I know the author, and helped out a bit with the book.
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."