heredago's blog

November 28, 2012

QUORA program python howto

Filed under: Uncategorized — Tags: , , , , — heredago @ 11:02

Learning to Program: What are the best sites for learning programming?

REDDIT: I waste roughly 6 hours a day in front of my work computer. What’s something useful/fun/helpful I can do with my time besides redditing?

 

 

36 Answers

 
Nick Huber, Internet adventurer

 
I’ve been spending 6-8 hours/day teaching myself to program for the past month or so and have basically scoured the Internet for every free or semi-free tutorial out there.

Here’s the good stuff I’ve used and recommend:

  1. CodeHS (codehs.com) — Personally graded, video-then-program format problems, starting with a toy language called Karel and moving up to Javascript, culminating in you making the game Breakout in your browser. Founded by two ex-CS106a TAs at Stanford from which the curriculum was largely adapted. They have probably 40 hours of really good content and, most importantly, provide you friendly, one-on-one help with like ~3 hours turnaround when you need it. Check out my version of Breakout I made after doing all of the content:EpicBreakout (thenickhuber.com). (1)
  2. Google’s Python Class (google.com) — Unlike above, requires some set-up on your machine (i.e. you’re not coding in-browser), but still good. About two days worth of lectures on Python with a handful of good problems, culminating in regular expressions (like a custom CRTL + F in a Word document) and a problem where you descramble an encoded image from a website.
  3. CodingBat (codingbat.com) — Python and Java problems. No frills, just the exercises — probably better for someone with a little bit of background (meaning you know what a function/parameter is and can use The Google to figure out/find syntax/functions you need). The site was made by the same guy who taught the Google Python Class.
  4. Khan Academy (khanacademy.org) — A few intro tutorials (mostly graphics/animation-focused) in JS using a well-regarded library (Processing.js) and then a wide-open project space for you to see programs other people have made (i.e. the end result and the code) and to make your own, potentially forking off of their work. Here’s a game that some guy made that served as inspiration for my version of Breakout: Mercury Subspace (khanacademy.org). Pretty great, right?
  5. Codecademy (codeacademy.com) — Solid read-then-write-code format of small problems broken into different subpieces. I used their HTML/CSS tutorials to get a basic background before making my personal website (http://www.thenickhuber.com/) and am going to use their stuff on more advanced JS and jQuery when I get to it (I think it’s better than, and comparable in approach, to Code School (codeschool.com)). Still, their grader is a bit buggy and there’s a large variance in course quality/overlap in material, since everything is written by different people.
  6. Learn Python The Hard Way (learnpythonthehardway.org) — Read-then-implement exercises, starting from no assumed knowledge. Good, but still not as good as interactive problems; I gave up after doing ~20% or so of it because it’s unapologetically repetitive, but have read lots of good reviews of it.

Other good stuff I want to check out:

  1. Stanford iPhone course (all slides and assignments: http://www.stanford.edu/class/cs…) — an iPhone app seems like such a good early project, because it’s so easy to show your friends what you’ve made, but have to figure out how completeable it would be for me. Also, you can’t get your problem sets graded if you’re just working on your own from the material online.
  2. K&R (http://www.amazon.com/Programmin…) — Highly regarded intro book on C and implementations of the most canonical algorithms. (If you know of a website that tries to do something like this, would love to get it from you.)
  3. The many CS courses on Coursera (coursera.com) and Udacity (udacity.com). However, I think it’s really important that you have someone grading your work so that you can get feedback (and that you actually do the problems rather than just watch the lectures). I’m not sure if this is possible if you take the course “off-cycle” and how good the problems are, but still worth taking a look.

After a month, I’ve now got a better idea of what I can make and this then informs things that I think would be cool to make. At this point, I’m most excited about continuing with this project-based learning approach as I think it’s more effective/lasting/fun than more tutorials/classes, but it’s still tough to get this outside of the university/work environment.

  1. Note: it’s unwinnable right now — I need to refactor and expand it, including a bunch more powerups and the final showdown with our hero’s final boss, The Brick King. FYI, my high score is like 550 and the game gets buggy at high levels. Switching to bullets helps and actually adds some unexpected difficulty. Would love to get your feedback/ideas.
 
8+ Comments • Share (22) • 21 Nov
 
Nick Huber

 
David Cole, designer at Quora.

 
Nick Huber’s answer is killer, I just want to add the set of resources I used that together formed a kind of singular, linear learning experience for me.

Before I joined Quora, I had never written a lick of Python and my programming experience was limited to goofing around in WordPress theme code. To prep for my upcoming job I tried a few different resources including the popular recommendations like the Google Python class, Learn Python the Hard Way…nothing really clicked. I don’t doubt their quality, but everyone has their way of learning.

My goal was to be able to build a complete application from concept to deployment, so I was looking for tutorials that took me along every step, assuming nothing and taking me all the way to a running application on a production server.

I asked the engineers at Quora what they recommended for an introduction to Python and they pointed me to Think Python: How to Think Like a Computer Scientist (greenteapress.com). This ended up being a perfect resource, as I really connected with the way everything is explained. It balances the philosophical with the useful, and the exercises don’t ever feel too rote. It’s both a primer on Python and on the general, cognitive aspects of programming.

As a follow-up learning experience (excluding the undeniably immense learning I get on the job) I started building my own projects with Flask (pocoo.org). Their tutorial for building a basic application assumes very little, and the aforementioned book gave me the footing I needed to zip right through it. I had initially started with Django, but it felt very heavy. With Flask I feel like I understand each thing I’m doing, even if there’s a lot of wizardry underneath.

Flask has a nice level of community support, and Heroku has a tutorial (Getting Started with Python on Heroku (heroku.com)) that holds your hand through the process of deploying a Flask application to one of their servers. It’s not quite the final step in the process because Heroku doesn’t support SQLite, which the Flask tutorial uses, so I had to connect that one last dot.

Fortunately, an article about precisely this had already been written: Flask and PostgreSQL on Heroku (y3xz.com). This post wasn’t as newbie-friendly as I’d hoped, but with the help of Postgres.app (postgresapp.com) (to get Postgres running locally), the SQLAlchemy Documentation (sqlalchemy.org), and good old fashioned guess-and-check, I achieved my goal of getting a simple web application deployed onto Heroku.

There were detours, like boning up on the command line (Unix Command Line Tutorial (peepcode.com)), getting deeper into Git (Git Is Simpler Than You Think(nfarina.com)), finally figuring out what the heck the PATH varible is (The PATH Variable (purdue.edu)) — lots of little learnings. But all in all, it was really these two core resources, Think Python and Flask, the theory and the practice, that have been the most valuable uses of my time.

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: