News for hackers. Stuff that matters.
Re:How to Design Programs 2nd Edition [free] by catamount on Saturday April 08, 2023 @11:59AM (#35494542)
This book should really be called "How to Design Functions" -- not "Programs" -- because it sidesteps the most difficult and interesting topics in making software programs, namely the work of a) separating a task into simpler subtasks and then b) composing smaller functions into a program that performs the task. IIRC the most complicated example in this book pertains to calculating the optimal price of movie tickets. There is merit in some of the book's recommendations. But overall this material could be condensed into the 25-page intro of a much more interesting programming textbook. As it stands, HTDP is a buzzkiller.

Speaking of which, here's a 2010 blog post about how Georgia Tech stopped using HTDP, featuring an argument in the comments between the author of HTDP and Alan Kay.

https://computinged.wordpress.com/2010/05/11/playing-the-car...

Re:How to Design Programs 2nd Edition [free] by systems on Saturday April 08, 2023 @12:44PM (#35495083)
I agree, programs are files, not functions If you want to show me how to design programs you need to show me how to break my analysis of the requirement, into modules, components and files

And then how to build and assemble those pieces into the running file (the executable)

When you open a Github project you are greeted with a file tree, not a function tree

we still program to disk not to a database, where functions exist in an abstract space

Re:How to Design Programs 2nd Edition [free] by zadberry on Saturday April 08, 2023 @05:22PM (#35497764)
I wonder which edition of HtDP you read? Your comments are somewhat true of the first edition (in terms of the exercises provided), and as far as I know, the authors were aware of such criticsms. In any case, since then, Racket has been enriched with various HtDP student libraries, including a novel pedagogic I/O framework called Universe [0], and the second edition of HtDP/2e utilizes these libraries for a number of relatively complex beginner projects, including a one-line text editor, a Tetris clone, an MP3 database, and a (very simple) interpreter. There are quite a few more. All of this material guides students to an understanding of your points A and B.

Also, there are quite a few sibling courses now in what I sometimes call the "How to Design Programs extended universe", and some of these are a bit more project-focused. In particular, there is Marco Morazan's Animated Program Design [1], which iteratively develops a multiplayer Space Invaders-type game called Aliens Attack through multiple sections over the course of the book. The main pedagogic aims of the Universe framework are to introduce students to both event-driven programming and distributed programming, and as far as I'm aware, the Aliens Attack program is the most complex tutorial treatment of an HtDP-style program that combines both aspects. Unfortunately, the book is quite expensive.

Personally, I didn't find HtDP to be a buzzkiller, but rather the textbook that helped me understand that programming could potentially be a joyful activity rather than drudgery. As a former music teacher, I loved its insistence on practice and process. But I was also a beginner who had tried and failed to learn to code a few times over the 15 years before I read HtDP/2e. A more experienced programmer surely might not have the same experience.

[0] https://www2.ccs.neu.edu/racket/pubs/icfp09-fffk.pdf

[1] https://link.springer.com/book/10.1007/978-3-031-04317-8

Re:How to Design Programs 2nd Edition [free] by uxcolumbo on Sunday April 09, 2023 @07:39AM (#35501784)
Thanks for posting this and your experience.

I had HTDP on my to-learn list and the parent comment somehow put a damper on it.

The space-invaders project sounds fun.

Re:How to Design Programs 2nd Edition [free] by zadberry on Sunday April 09, 2023 @04:32PM (#35506206)
Worth mentioning that there is a Space Invaders project included in the first section of HtDP.

Personally, I wouldn't give Morazan's Animated Problem Solving a big recommend for someone trying to self-teach CS1, especially not when HtDP and How to Code are free. In my opinion, APS is a bit over-stuffed (it has a tendency to throw relatively advanced terms, like property-based testing, at the beginning student without much follow-through) and it can sometimes make exercises (including the game ones) overly complex and tedious.

I don't think HtDP is without criticism, but if you can get through the admittedly slow first section, it's a great textbook. Alternatively, you can work through UBC's How to Code (H2C), which has a brisker pace. Note that you can actually access the version of the H2C for UBC students at the CS110 course page [0], just click on the link to enroll in the "edX Edge course". It appears to be an updated version of the original course with some small additions.

I found the first section of HtDP a bit slow myself, so I ended up working through H2C first. I only came back to HtDP because I found some of H2C's explanations of the later material shallow, but more importantly, I felt that the exercises were generally lacking in challenge. Nonetheless, I can't recommend H2C enough. Gregor is a friendly, patient teacher, and the H2C presentation of the design recipes somehow seems more fine-grained than HtDP's versions without feeling overly complicated.

[0] https://cs110.students.cs.ubc.ca/