If you’re like I was when I started this journey in July 2011, you’ve never even seen code before in your life. Here are some of the resources I used, with a quick review to get you started. The resources here start simple and get increasingly complex with extras at the end to make finding answers to your questions easier.
First and foremost, I recommend you use the set up that Zed Shaw recommends here. We’ll get back to Zed in a moment but for now use his set up, install python 2.7 (I do NOT recommend starting with Python 3 as most learning resources haven’t caught up with that yet), learn how to open the command line and move around directories, move files and open .py and .txt files, learn how to save a .py file, get used to typing parentheses, brackets, and curly brackets. Fortunately python has VERY simple syntax, especially compared to other languages so don’t worry about spending all your time looking through your code for misplaced curly brackets, but you will have to use them and you should get comfortable typing them.
Snake Wrangling for Kids
The first book I recommend is called “Snake Wrangling for Kids” which is a childrens book for learning to code. Yes, it’s a kid’s book, but swallow your pride, read it and try a bunch of the exercises. I personally just skimmed through the end which has you drawing little spirographs using tkinter. This bores me and goes against my learning philosophy which is, learn what excites you.
Learn Python the Hard Way
This book is highly recommended and not just by me. The author, Zed Shaw, has a knack for teaching without making the subject overly complicated. You’ll be writing a fun choose your own adventure game in no time. You can use the html version for free, but if you can spare a few bucks, buy his book and support this very helpful programmer.
A few caveats… Zed doesn’t do the best job of explaining Test Driven Development. He doesn’t get into this till much later in the book so don’t worry about this too much. I do recommend learning this style of programming at some point, but if this book doesn’t do it for you, you are sure to run into it again later in your journey. Also, at the end he has you using a web framework you aren’t likely to use much after these exercises, with the option of Django. The popularity of Django is a detriment to beginners, in my humble opinion. It is powerful, but NOT easy, all things considered. More on web frameworks later.
How to Think Like a Computer Scientist
My next favorite book is “How to think like a Computer Scientist.” He gives you a much more thorough understanding of concepts then you’ll get from LPTHW. It takes you from absolute beginner to much more advanced subjects. There are lots of great exercises to drive the concepts home. This book honestly does what it says and teaches you how to think.
If you are a fan of lectures from college professors and complex problem sets, then you have to check out the various opencourseware from top notch institutions like Harvard, Stanford and MIT. I’ve only used the MIT OCW but it is absolutely fantastic. You can also take advantage of help from other students taking the course through OpenStudy.
If you’re interested in learning web development, learn web2py. This should also wait until you’ve got a little python under your belt as your focus should be on learning a language (python) and not just a webframework (web2py). That said, this web framework was designed by a computer science professor for his students and it’s clear. It’s designed to always be backwards compatible and get you creating web apps in record time. There is a lot of magic (a word which hear means ‘lots of stuff happens behind the curtain which you don’t see’) which goes against the Zen of Python dictum ‘Explicit is better than implicit,’ but it’s a trade off with another dictum, ‘Simple is better than Complex.’ (For more on the Zen of Python, open your python interpreter then type:
import this ).
There are some other popular books that you may run accross. Dive into Python is one of them. I am NOT a fan of this book. It’s written by programmers, for programmers so if you already know some other programming language, then DIP will get you up to speed in no time. For the rest of us, however, this book is hard to differentiate from an intro to greek written in latin. Other books like, “Learning Python” and “The Python Cookbook” from Oreilly Publishing are good resources, but more like references (which you can get online by reading the docs) then instructional guides.
Many Computer Programmers don’t like to let on that they don’t know everything. If you’re writing source code, you’re learning about new tools and concepts to make what you do more fun and effective. If you have a question, chances are someone else has asked it so do a search at StackOverflow.com. If it hasn’t been asked yet, chances are that someone else would like to ask it or will ask in the future so do yourself and others a favor and ask. This is a great site for doing just that.
One last word to the wise. When you are first getting started it’s best to learn something popular. I’ve kept this in mind while writing this post. How does popularity translate in this situation? Something that has an active mailing list, IRC and otherwise good community support. Python and web2py both fit into this category.