HN Academy

The best online courses of Hacker News.

Hacker News Comments on
Design of Computer Programs | Udacity Free Courses

Udacity · 2 HN points · 24 HN comments

HN Academy has aggregated all Hacker News stories and comments that mention Udacity's " Design of Computer Programs | Udacity Free Courses" .
Course Description

Take Udacity's free Design of Computer Programs course and learn new concepts, patterns and methods that will expand your Python coding abilities. Learn online with Udacity.

HN Academy Rankings
  • Ranked #7 this month (may/jun) · view
  • Ranked #15 this year (2024) · view
  • Ranked #25 all time · view
Provider Info
This course is offered on the Udacity platform.
HN Academy may receive a referral commission when you make purchases on sites after clicking through links on this page. Most courses are available for free with the option to purchase a completion certificate.
See also: all Reddit discussions that mention this course at

Hacker News Stories and Comments

All the comments and stories posted to Hacker News that reference this url.
1. Peter Norvig's Design of Computer Programs course on Udacity probably singlehandedly changed my perspective on thinking and modeling software solutions to problems.

2. Crafting Interpreters by Robert Nystrom is of similar quality. There are a lot of 'oh that's how that works' moments in this book.

3. Doyle Brunson's Super System 2 is of a similar nature, but for poker. It's outdated these days because the nature of the game has changed so much due to the internet and a shift in meta strategy, but it's really insightful in understanding the human aspects of the game. His perspective as a 'gambler' rather than poker player is also unique, because he talks a lot about prop bets and identifying when you have an edge in a bet.

4. Stephen King's "On Writing" is a masterpiece of a memoir of a man and his craft. My own writing improved significantly as a result of this book.

+1 Peter Norvig's class. His approach is totally fascinating and the way he effortlessly translates common-thinking and logic into a program is pure magic to me. Highly recommend it and also checkout his notebooks, unparalleled beauty:
I am reading Crafting Interpreters right now. It seems to be a solid book but I am curious how others read it?

Do you reproduce all, or most, the code yourself? That’d be a great way to make everything stick but makes progress terribly slow.

My approach was to port everything to a different language I was learning.
Same as others. I took it as an opportunity to work with Rust and enjoyed it a ton! Crafting Interpreters has been ported to any language you can think of so try that approach out!
I'm in the process of reading Part II (the Java interpreter) thoroughly on the toilet, then will implement Part III (the C bytecode interpreter) in Zig. That way I understand the concepts well but end up with something a bit nicer for my efforts. I know I wouldn't finish the bytecode interpreter if I did both parts fully.
If you liked Stephen King's "On Writing", give William Zinsser's "On Writing Well" a read. It's not a memoir but more like a manual addressing different types of writing from corporate writing to sports to academic.
If you liked William Zinsser's "On Writing Well", give Joseph M. William's "Style: Toward Clarity and Grace" a read.
I'll check it out. Thanks for the recc.
Jul 19, 2022 · Thursday24 on How to Design Programs
I prefer Norvig's "Design of computer programs" over this:

I learned how to build a vocabulary for the problem domain first, and then use the vocabulary to solve the actual problem through this course. Norvig has great examples on bottom-up problem solving approach.

There needs to be a slight 'middle up' come back.
Could you elaborate on what that means a little?
Likely a reference to the sit-com Silicon Valley.
when you're doing neither top-bottom nor bottom-up. I think pg or some other lisper described that by a set of thin DSLs, so not purely bottom-up, something a bit more agile.
They're both worth checking out. The biggest complaints I've seen about either were about the pace: slow for HtDP, fast for Norvig. I think HtDP's recipes are worth reviewing even if you'd get bored with its pace.
Good question. I guess my answer is not really. I'm not sure why I haven't sought out more of this kind of thing.

Still, a couple of random things I can think of:

The Spatialite Cookbook is no longer maintained, but I think still useful. That's structured as a sequence of fun exercises:

I also enjoyed Peter Norvig's Design of Computer Programs online course:

He created one of the first courses on Udacity, Design of Computer Programs. It's free and quite good, from what I hear.

Yes. Very good, & also challenging :) Highly recommend
Agreed, this class was a masterpiece. Changed the way I write software
Jun 06, 2021 · 2 points, 0 comments · submitted by swatson741
Thanks for the recommendation! It looks quite good. Assuming you're referencing this:

I have been meaning to brush up on my interview skills, and I've found the lack of structure in LeetCode's Monthly problem sets to be quite frustrating. Every time I'd get stuck on a certain problem, I'd dive deep into the techniques behind the solution just to discard that knowledge the next day, as the selection of problems was seemingly random.

Norvig teaches a really cool, and challenging, class on Udacity called the "Design of Computer Programs"[0] in Python where you can learn his thought process on how to write reliable and beautiful software to solve interesting problems.


I quite enjoyed -- program design by Peter Norvig. (Disclaimer: I had a very small part in preparing it.)
+1 for this. It's quite python-specific, but I found it amazingly insightful.
I'd disagree with amateurish.

I agree that some of what they're advertising looks like 'intro to web bodging' and 'learn to mash tables without learning the maths', but there's also Norvig:

Granted, I haven't actually paid them any money.

Norvig and Thrun's Introduction to Artificial Intelligence class was pretty awful. I hope their offerings improved since the original class in 2011, but I'd be wary of paying money for any classes with their names attached to it. On the other hand, Widom's database class and Ng's ML class were excellent.
You should check out Norvig's design of computer programs course on Udacity ( where he uses these kinds of puzzle programs to teach programming design concepts. It is a hard but really rewarding course.
His Design of Computer programs course on Udacity is amazing.

The problem with this course is that it is quite boring if you're not interested in given subjects - e.g. Poker lectures make me sleepy.
He's not really trying to teach you poker or even how to write a poker program but rather how to solve problems by programming.
Solve problems in particular domains - i.e. you have to understand the domain, learn rules - and it is very boring if the domain is not interesting for you.
GP just means poker as an example it vehicle bores him. I agree - same with deck of card exercises.
Tried to go through the course a few years ago. In my case it was the regex bit. Trying to write the code is a massive chore with with very little payoff for going through it, and needing to go through the instructions several times in a row. Gave up on the course there.
Great course, learned a ton from it, but yeah lesson 3 where you had to build / follow him building a regex interpreter was definitely a beatdown for me. Everything else was pretty manageable, but still challenging.
Some people gave up on that section (week 5 of 10) and went on with the rest of the course. That seems to work out OK.

(I felt a little bad about these reactions because I'd helped with that code. In its defense, I've also been told by a couple of people that they gained a lot by working through it.)

At one point I a friend was mentioning the regex golf comic and how some insane person on the internet solved it. I mentioned my pains with the regex bit of the Design of Computer Programs course, and how Norvig had some Chtulhu like ability to write regexes that befuddle mortal minds. Lo and behold, it had been Norvig all along solving that. Python notebook available in the pytudes above.
I second this. It's interesting and informative to watch him break down programs and to see his code. Plus, you get treated to selections from his Hawaiian shirt collection.
I have three recommendations:

Think Python:

Polya's How to Solve It:

Udacity's Design of Computer Programs:

Thank you so much for posting these links. I started reading How to Solve It and am a few pages in, and am so happy to have found this book. This is the value that I find here at HN that keeps me coming back every day. The new tools and new technologies, and the interesting tech news are all very interesting, but none as valuable as the gems that people leave in comments for others to discover, thereby enriching their lives.
there's also Clean Coders:

these videos are quirky (!) for sure, but filled with some real gems and a depth of perspective that's rarely found in other online courses.

the link goes to a free video intended as an intro to the aspiring programmer.

I'm posting this only because I've seen several of these videos and think they've got something special.

It's from the guy who wrote Clean Code and Clean Coder which are gems themselves !
If people like this, also check out his course at Udacity -
> Please don't be like Udacity

Huh? Udacity has numerous free courses. They've never made a free course non-free. Any new paid course is developed with new material, and they're still churning out free courses.

Here's one of the gems from the early days of Udacity - Peter Norvig's Design of Computer Programs:

And here's one of the early machine learning courses:

Peter Norvig's "Design of Computer Programs"

An introduction to some semi-advanced programming concepts using an accessible language like Python, taught by a giant of CS.

Steve Huffman's "Web Development"

Basics of developing a web application, it uses Google App Engine as a base but the concepts taught are easily extensible to other platforms. Steve comes off as a likable and competent teacher.

My all star lineup would be:

The Analytics Edge -

Design of Computer Programs -

Justice -

If I had more time I would love to go through the bioinformatics specialization on Coursera. They have 2 books and an exercise site ( It looks like great fun.

+1 for The Analytics Edge.

Along the same lines but a more thorough treatment of linear regression and statistical inference is the excellent Data Analysis and Statistical Inference

Design of Computer Programs was decidedly the best course I ever took online. I was lucky enough to take it when it was first offered. Peter Norvig was very active in the course forum.
Peter Norvig is really an impressive teacher.

I have been doing his course "Design of computer programs" ( and it really push me from basic/novice developer to intermediary.

He succeed to explain you things in a natural way. He seems to always start by the basic assumption. Working and thinking around any problems/surprises he/you encounter. So, you have the impression to discover things more than learning them.

I didn't realize he taught any udacity courses, thanks for the link!
I frequently and Highly recommend "Design of computer programs" to everyone I can. As an intermediate developer before taking it, I still recommend it. He is an amazing teacher I have learned considerably just from the way he explains and approaches problems.

Plus taking a class for free from the director of research at google :)

Google Schmoogle - Peter Norvig is a powerhouse name and Google gains in prestige for having Peter Norvig, not the other way around.
'Newbie' covers many experience levels - from afraid to turn the computer on to moving beyond Excel pivot table macros. People need different degrees of handholding.

Not necessarily my favorite, Coursera's Programming for Everybody [1] moves forward very very slowly. Great for some people, drying paint for others. It is taught in Python.

A course I think is great is Coursera's Introduction to Systematic Program Design [2] based on Felleisen's How to Design Programs introductory text. It is possible to register for the last session, from a year ago, and complete the work on your own. It is taught in Racket.

Another course that takes a learn-by-making approach is Coursera's Creative Programming for Digital Media & Mobile Apps [3]. It is beginner friendly and really encourages "getting into it". It is taught in Processing, and in some ways I think Processing is the ideal language for an introductory course in Software Engineering - it is pared down like Racket's student languages, provides just a pinch of Java pain, facilitates the production of really interesting output, and the environment provides a fast edit-compile-run loop.

For a person who is more oriented toward scientific or mathematical problems, Coursera's R Programming [4] might by a good fit.

Among the various Python Courses, I would probably go with Udacity's Design of Computer Programs: Programming Principles [5] because it is taught by Peter Norvig.

All that said, a book may be better than an open-enrollment class for many people, and there's a lot more variation.






Thanks! Reminding myself of her feedback I think that pacing might be a significant issue which is something I hadn't considered too much (oddly).

She's someone that has lots of computer experience but the closest she's gotten to programming before is simple Excel functions (think SUM). I think she'll be much more excited by one where she's working on "real world" stuff so I'm leaving a bit towards Creative Programming for Digital Media & Mobile Apps and hope that it spurs her to learn even more.

> I believe in the real world, you are best represented by a body of work and/or the ability to demonstrate that you are capable of tackling the problems associated with the job in which you are considering.

This is such a good advice! I remember reading Norvig's spellchecker[0] and said to myself: "This code is so elegant and beautiful. I could never write something like this."

I learned more about NLP, learned some Scheme, worked through Norvig's Design of Computer Programs[1] and improved my Python a lot.

What have I learned? Firstly, people like Norvig have tons of experience and are incredible clever. Also they have worked in the same (or similar) domain for decades. Of course they know cool data structures and algorithms for NLP problems. Back then I didn't realize this and thought that I was dumb. Today, I'm less dumb and know that it takes time and experience. Build, learn, build, learn, ...



Experience is more about knowing a million little tricks than it is about actual domain knowledge. Norvig's spelling corrector is an application of inverting the problem.

Instead of attempting to correct a misspelling, he attempts to misspell a word, then stores the misspelled word along with the original word. Then, to correct a misspelling, you simply look it up in the hash table.

Incredibly powerful mathematical concept that inversion thing. And there's a million of them.

Other "tricks":

* shuffling a deck of cards in O(1) (or shuffling anything at all)

* sorting in O(N) (with a limited keyset, and guaranteed no repetitions it's easy. Think about it).

* knowing the url to MIT's bit twiddling manual [1]

* know how to "rewrite" english (or any language) text. Really impressive. Also, mostly useless. It's called Markov Chains.

* understand how and why "every language compiles first to LISP, then to machine code" is true. Thinking about this yields no end of clever programming tricks

* make sure to have spent a few months in each style of programming. Imperative (doesn't tend to be a problem). Functional (NEVER change the value of a variable, ever, for any reason). Dynamic (write a calculator using eval, and go from there. Exploit it).

* having the experience that any style of configuration eventually ends up being a turing complete programming language, and so you should just import and use an existing language

* having experienced the power of query languages. Instead of having a few reports, implement an interpreter that allows you to query them. Then amaze everyone by having every new report they ask for done in 10 minutes.

* knowing the power of automated source translation tools, and how easy these things are to write IF you can munster the discipline of never touching generated code

All of these things will have people tell you it's impossible. And when they see simple code that demonstrates things like this, it's cheating (e.g. O(N) sorting is not fully general. That doesn't make it slower than O(N), and it's still applicable to a lot of situations) ...


why isn't it Stanford's manual?
Heh. Whoops. I got the link from MIT Opencourseware originally.
> shuffling a deck of cards in O(1)

How? I'm aware of Knuth shuffle which is O(n) but I can't find anything about constant time shuffling.

You use the algebraic property that xy mod n will generate a shuffle of Zn if y and n are relatively prime (don't share any divisors). So if you then redefine "element a" to not refer to the index of the original array, but to ay mod n, and you've got your shuffle. You pick y randomly, and in order to make y and n relatively prime, you simply change n to be a prime number.

None of this requires you to actually go through the list. You'd have to modify this to support lists of non-prime lengths, but this is the basic idea :

  import random
  lst = [1,2,3,4,5]

  class newlist:
      def __init__(self, lst):
          self.lst = lst # assuming lst has a prime length.
          self.y = 0
          while self.y % len(lst) == 0:
              self.y = random.randint(1, 999999)

      def __getitem__(self, index):
          nidx = (index * self.y) % len(lst)
          return self.lst[nidx]
  # Start shuffling
  nl = newlist(lst)
  # End shuffling ... algorithm done.

  for i in range(len(lst)):
          print i, nl[i]
Norvig teaches a Design of Computer Programs course on Udacity, which helps you think about solving problems.

I'm not sure whether you are trying to learn to program in general or Python in particular, but you might try out something like ["Design of Computer Programs"]( from Udacity. It's very engaging, somewhat difficult but you'll learn a lot.

Another thing you might try is taking a book with examples in one language and try to implement them in Python. It's a little weird but it can be a great way to have a framework for a task but have to explore on your own.

"I worry that it could be a waste of time"

It's education. If you want to stay 20 years in this industry, you have to invest in your education. Don't worry, just do it. Solving the problems would make you a better problem solver.

"I feel that most prospective employers don't really care about that, though."

That's right. Most prospective employers don't care. Don't work for them. If you have to, read my last answer.

"In otherwords, is SICP worthy of a CV bullet point."

Yes, really good developers would appreciate the effort. Employers won't care but the senior developer taking your technical interview may appreciate it.

"I should be focusing on more practical projects before looking for a first job." Yes, you must do that. Nothing beats showing a perfectly operational website. And depending on the profile you are targeting it can be a Android game or Web game or scraper or anything. Don't worry your github profile yet. Once you start building stuff it will come alive.

You can also check out for some practical courses. They are taught by awesome people and are free. All these courses focus on a project to teach you basics of computer science. And you get real world skills.

1. Building a Search Engine - Introduction to Computer Science -

2. Building a HTML5 game - HTML5 Game Development -

3. Building a Blog - Web Development -

4. Building a Browser - Programming Languages -

5. Building blocks of any non - trivial software project - Design of Computer Programs - .

All the best learning CS, building things and contributing to the world.

Second the Udacity courses. A lot more meat than the normal beginner stuff. If you're feeling ambitious the Norvig course is good.

The programming languages (cs262) or web development (cs253) courses would probably be a better place to start.

The intro course is also worth taking a look at.
You can also take a free course online ( by Peter Norvig with Udacity ( in case you can't make it to hacker school.
HN Academy is an independent project and is not operated by Y Combinator, Coursera, edX, or any of the universities and other institutions providing courses.
~ yaj@
;laksdfhjdhksalkfj more things ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.