Hacker News Comments on
Design of Computer Programs | Udacity Free Courses
Hacker News Stories and CommentsAll 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.
⬐ systemvoltage+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: https://github.com/norvig/pytudes⬐ 6ak74rfyI 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.⬐ fantod⬐ luuuzetaMy approach was to port everything to a different language I was learning.⬐ mminkovSame 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!⬐ ok_dadI'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.⬐ rahimnathwaniIf you liked William Zinsser's "On Writing Well", give Joseph M. William's "Style: Toward Clarity and Grace" a read.⬐ luuuzetaI'll check it out. Thanks for the recc.
I prefer Norvig's "Design of computer programs" over this: https://www.udacity.com/course/design-of-computer-programs--...
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.
⬐ agumonkeyThere needs to be a slight 'middle up' come back.⬐ pindab0ter⬐ abecedariusCould you elaborate on what that means a little?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: http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/index.h...
I also enjoyed Peter Norvig's Design of Computer Programs online course: https://www.udacity.com/course/design-of-computer-programs--...
He created one of the first courses on Udacity, Design of Computer Programs. It's free and quite good, from what I hear.
⬐ donkey-hoteiYes. Very good, & also challenging :) Highly recommend⬐ nick0garveyAgreed, this class was a masterpiece. Changed the way I write software
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" in Python where you can learn his thought process on how to write reliable and beautiful software to solve interesting problems.
I quite enjoyed https://www.udacity.com/course/design-of-computer-programs--... -- program design by Peter Norvig. (Disclaimer: I had a very small part in preparing it.)
⬐ hiyer+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: https://www.udacity.com/course/design-of-computer-programs--...
Granted, I haven't actually paid them any money.
⬐ wlNorvig 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 (https://www.udacity.com/course/design-of-computer-programs--...) 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.
⬐ zerrThe 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.⬐ pvg⬐ dpflanHe's not really trying to teach you poker or even how to write a poker program but rather how to solve problems by programming.⬐ zerr⬐ Err_EekSolve 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.⬐ sotojuanGP 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.⬐ solaxunGreat 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.⬐ abecedariusSome 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.)⬐ Err_EekAt one point I a friend was mentioning the regex golf https://xkcd.com/1313/ 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: http://greenteapress.com/wp/think-python-2e/
Polya's How to Solve It: https://en.wikipedia.org/wiki/How_to_Solve_It
Udacity's Design of Computer Programs: https://www.udacity.com/course/design-of-computer-programs--...
⬐ tapan_kThank 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.⬐ amgandothere's also Clean Coders: https://cleancoders.com/videos/programming-101
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.⬐ louhikeIt'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 - https://www.udacity.com/course/design-of-computer-programs--...
> 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: https://www.udacity.com/course/design-of-computer-programs--...
And here's one of the early machine learning courses: https://www.udacity.com/course/intro-to-machine-learning--ud...
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 - https://www.edx.org/course/analytics-edge-mitx-15-071x-0
Design of Computer Programs - https://www.udacity.com/course/design-of-computer-programs--...
If I had more time I would love to go through the bioinformatics specialization on Coursera. They have 2 books and an exercise site (rosalind.info). It looks like great fun.
⬐ geomark+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 https://www.coursera.org/course/statistics⬐ amykharDesign 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" (https://www.udacity.com/course/cs212) 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.
⬐ stevenspasboI didn't realize he taught any udacity courses, thanks for the link!⬐ dm03514I 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 :)⬐ innguestGoogle 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  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  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 . 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  might by a good fit.
Among the various Python Courses, I would probably go with Udacity's Design of Computer Programs: Programming Principles  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.
⬐ bredmanThanks! 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 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 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, ...
⬐ wapsExperience 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.
* 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 
* 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) ...⬐ allardwhy isn't it Stanford's manual?⬐ waps⬐ dteohHeh. 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.⬐ wapsYou 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"](https://www.udacity.com/course/cs212) 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 https://www.udacity.com/ 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 - https://www.udacity.com/course/cs101
2. Building a HTML5 game - HTML5 Game Development - https://www.udacity.com/course/cs255
3. Building a Blog - Web Development - https://www.udacity.com/course/cs253
4. Building a Browser - Programming Languages - https://www.udacity.com/course/cs262
5. Building blocks of any non - trivial software project - Design of Computer Programs - https://www.udacity.com/course/cs212 .
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.
⬐ tekromancrThe intro course is also worth taking a look at.
You can also take a free course online (https://www.udacity.com/course/cs212) by Peter Norvig with Udacity (https://www.udacity.com/) in case you can't make it to hacker school.