Hacker Newsnew | past | comments | ask | show | jobs | submit | debanjan16's commentslogin

Different things workout for different people. I was overwhelmed by so many ways to do things in Python and everybody teaching their own favourite way of doing things. Similarly, all I was learning was the syntax and no problem solving skills.

Then I cam across the book How to Design Programs aka HTDP. I was skeptical at first. But I eventually started and worked through the second edition of the book available freely at https://www.htdp.org .

It was so beautiful. The teaching languages and writing examples before writing code. It made me really understand programming.

Now I can pick up any language (not that I become a language expert overnight) in a short time. I only need to map the concepts to this new language. And that's that. I can even pattern match my ideas from higher order functions to imperative looping constructs.

I have another book in to TDR list. It is Norvig's Paradigms of Artificial Intelligence Programming.


Even beginners can learn to program in a data oriented way from the beginning.

Two books that teach this style of programming to beginners are:

1. How to Design Programs - https://htdp.org/

2. A Data-Centric Introduction to Computing - https://dcic-world.org/


Those are not this.


Can you elaborate a bit more on the reason?


The books you presented are, roughly speaking, introductions to programming with a focus on data science, functional programming, and common structures/ideas used in those which are, in other texts, not usually considered introductory material. "Data" in this sense means, like, collected facts about the world and how to model them.

Data-oriented design is a particular way of designing your programs where you focus on efficiently laying out your "data" - in a different sense, meaning "whatever it is I've got in storage" - within that storage - to compute with it as fast as possible.

The industry-standard tools used for the first thing are often using techniques developed in the second of the second thing, but that's not relevant for the pedagogical framing. The tools they are teaching (Scheme and Pyret) actually make it very hard to play with low-level data layout details. And the emphasis in these texts on "real [as in, world] data" is in direct contradiction to the DOD axiom that "data is not the problem domain... The data-oriented design approach doesn't build the real-world problem into the code."

A rule of thumb: Is anyone talking about GPUs, SIMD, or CPU cache sizes? If not, you're looking at something about data modeling or data science, not data orientation.

And this, sorry, is all super fucking obvious if you actually read the intro to all three things.


I think this may be more akin to what you original comment meant: https://blog.klipse.tech/dop/2022/06/22/principles-of-dop.ht...

I got confused by the terms (Data Oriented Design and Data Oriented Programming) and watched Mike Acton's talk by mistake https://www.youtube.com/watch?v=rX0ItVEVjHc (and what a lucky mistake)


I was actually in the school of thought that this article describes until I read and worked through the book How to Design Programs [0]. The rest is upto you to judge.

[0] https://htdp.org/

Edit: I would love others, who have read the above mentioned book, to weigh in with your anecdotes.


> I was actually in the school of thought that this article describes until I read and worked through the book How to Design Programs

What distinguishes the approach from what is presented in this blog post, can you provide a summary for those of us who haven't read the book? I am sincerely interested.


The book utilises a series of Scheme based teaching languages to teach about how to write functions for increasingly complicated data types. The language levels produce meaningful error messages for programmers of that particular level and goes on adding language features as you progress through the book.

The book furthermore teaches a design recipe which comes in handy when you are stuck with a problem. Basically it teaches you to write examples first so that you understand the problem instead of jumping onto the editor to write code first. The examples help you structure your data. The rest of the code follows from it.



Not my favorite subject to be exact. But Probability really clicked for me after reading Probability Theory: The Logic of Science by E.T. Jaynes.


Since, you are the instructor for 15-150 this semester and have graduated from CMU as per the slides. I would like to know what you think about similar intro course sequences elsewhere.

Like BrownU's CS019 course using Pyret. It also teaches a functional approach to programming.

Also Berkeley's CS61A,B,C trilogy.

Do intro level courses matter in the long run? Or is it the higher level courses that set apart universities in undergrad CS education?


I'll preface that, since I haven't actually taken any of these courses, I lack the full nuance to be able to make as faithful of a judgement as someone who actually attended these universities.

That being said, I've certainly heard of Berkeley's CS61A, and in particular, Brown's usage of the Pyret language. From what I've gleaned from Brown's curriculum, it looks extremely solid for a one-semester course! Everything from K-means to BST invariants to graphs to DP. One question I would be interested in is how "naturally" the progression arises, as the class goes from topic to topic, as I don't necessarily immediately see the thesis of the course, but that may just be a preference in how I teach. I feel like 15-150 has a very clear and obvious story to how it progresses.

Berkeley's 61A, B, C progression looks solid in terms of how it slowly unravels the state of the world to students. In terms of specifically 61A, I might hesitate a little bit at teaching higher-order functions to first-time programmers in the second week, but again, I don't really have the full context to know how successfully that usually goes. In terms of topics, it looks more object-oriented than either 150 or Brown (in that 150 is not whatsoever, and Brown does not seem to be). Personally, I fear that OOP can lead you to too much focusing on specific machinery (inheritance, `self`, method resolution) as opposed to general programming concepts, like algebraic data, recursion, or compositional thinking. It has its place, but I prefer fundamentals to specific tools.

With respect to your question about intro level courses, personally I believe they're of utmost importance. CMU SCS's success as an educational institution is in absolutely no small part due to the fact that the school's intro courses are _chiefly_ run by undergraduate TAs, and so the undergraduate course sequence is one of the strongest you can find anywhere in the world. In just the first six courses, which earns a CS minor at CMU, a student becomes most formidable. By contrast, 70% of what I learned in upper-level courses at CMU, I do not use at my day job (except for compilers).


Btw, Brandon, I hope you archive your version of the course materials somewhere as they are really as good as the notes, someplaces, even better. All previous versions of 15-150 are basically non-existent.


I'd love to post the lectures recordings online -- that remains to be seen, though, whether that's something the university might permit. Thank you for the kind words, though.


Keep us posted about the lectures. I don't find a personal website of you. Then I would have bookmarked it.

There are so many awesome lectures from other CMU courses like Andy Pavlo's Database, Keenan Crane's Graphics courses.

I so hope CMU records their intro courses and put them out in public.


Ah! Thanks for the detailed reply. It is so good to hear from someone who have passionately benefitted from their undergraduate courses and gets to use knowledge from that in real life.

Btw with 15-150 notes and slides do you have any book suggestion in mind that self learners can read alongside?

Note:- There are some leaked lectures from Brown's CS019, if you want to look, here: https://learnaifromscratch.github.io/software.html#org464eb9...


Book suggestions are always so difficult to recommend. I've been asked this question many times, but honestly, it's hard for me, because I'm really not much of a (text)book learner. I know Structure and Interpretation of Computer Programs is supposed to be excellent, but honestly books like that just put me to sleep. It's part of the reason why I've put so much effort into my slides.

I'll say that if you want to learn functional programming in particular (in OCaml), the recently released second edition of "Real World OCaml" is an excellent reference. That one might lean more into specific OCaml language constructs than general programming know-how, though.

Otherwise, along with my notes and slides, I think the most important thing to do is just to pick a task and do it. It doesn't need to be something standalone, but I think everyone learning to program should program an expression evaluator, a priority queue, binary search, BFS, tree traversal, what-have-you. I know that the OCaml website also has a list of exercises: https://ocaml.org/problems

Robert Harper also has a book, "Programming in Standard ML", though that one doesn't have exercises, so my slides are meant to cover the same kind of material. It's here anyways, though: http://www.cs.cmu.edu/~rwh/isml/book.pdf

I hope this helps!

P.S. That Brown schedule looks absolutely intimidating. I'm not sure I could have handled Racket as a first-time programmer. I think it's so important to have a solid conceptual model of what the program is doing before you go into more advanced stuff -- our class only learned higher-order functions today, after 5 weeks of SML!


Thanks for the references!


Why is this awesome book posted again today? (I have no problem though). Even if one person is benefitted from it, the post is worth it.


How to Design Programs by Felleisen et al.

A breath of fresh air among all the trash introductory programming courses/books that teach nothing but syntax of a trendy language with little to no transferrable skills.


Apart from the font, all your questions are answered in the book's introduction. And this is still a work in progress.


I have to agree somewhat about the font choice, this particular one is good for textbook print but doesn't work well with a screen, too thin of letters is the short answer.


I did.

I used the book How to Design Programs to learn programming in a clean and functional way. I had to find the textbook that clicked for me.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: