
How to Design Programs, second edition - ghosthamlet
http://www.htdp.org/
======
trevyn
On this topic, one of my eye-openers was Game Programming Patterns:
[http://www.gameprogrammingpatterns.com](http://www.gameprogrammingpatterns.com)

It’s classic software architecture patterns, only seen through the lens of
performance and design iteration speed, which is the way I see the world even
though I don’t make what most people would consider games.

~~~
shadowmint
I’ve commented at length about this book before; really, just don’t bother.
It’s not very good at patterns, not comprehensive, not clear on how to use
them for games or why you might want to use them at all.

Google search “design pattern book”. Right, now take any of those books.

If you want game related stuff try “game programming gems”.

This book is free... that’s literally all it has going for it. Wikipedia has
better stuff that you know... actually compiles, etc.

If you got any value out of Game Programming Patterns, I cannot strongly
enough recommend you go and read an actually good book on design patterns;
you’ve probably been mislead by its vague hand waving and incoherent
discussion of the various topics.

~~~
isaachier
I completely disagree. I felt it was a modern followup to the classic Design
Patterns (Gang of Four) book. The author is not trying to teach game
programming as much as he is demonstrating how they are practical in his line
of work.

~~~
isaachier
After seeing the original debate I'm sure I won't add anything you haven't
heard already: Game Programming Patterns -
[https://news.ycombinator.com/item?id=14475489](https://news.ycombinator.com/item?id=14475489).

~~~
shadowmint
nope.

...but once again I recommend anyone who reads this post go browse wikipedia’s
design patterns section. Its pretty neat:

[https://en.m.wikipedia.org/wiki/Software_design_pattern](https://en.m.wikipedia.org/wiki/Software_design_pattern)

------
bjoli
I find that structuring your intro course around how to deal with data in
different forms is a fantastic intro. It lets you focus on the vital parts,
but in a way that lets you deal with the ugly parts (user interaction and
error handling) later on without changing much.

I really like this book.

~~~
johnc1231
What I also like about this book is that it manages to get to "exciting"
programs fairly quickly. Like, for a first time programmer, it can be boring
to spend all your time writing things that convert Fahrenheit to Celsius or
print staircases out of asterisks with double for loops. In this book, it's
very easy to work with images, allowing things to move towards things like
basic game development very quickly.

------
jonathanstrange
Although I like HtDP as a scheme book, I have to say that its title has always
been a bit misleading. It certainly doesn't teach you how to design programs,
it is rather a good introduction to common scheme programming techniques.

It teaches abstraction and techniques like streams and recursion. In that
respect HtPD is very similar to Winston & Horn's _Lisp_.

~~~
samth
I teach using HtDP, so my opinions are unsurprising here, but this is very
wrong. The central ideas in the book are about data-driven design,
specifications, systematic design of correct programs, and abstraction of all
kinds. These are fundamental program design techniques, not details of scheme
programming.

~~~
stephenhuey
Been a while since I took the intro CS course from Matthias at Rice (late
90s), but I do remember he was an eloquent teacher who really illuminated for
me the idea that you could simplify the design of complex programs through
formal techniques (as opposed to the cowboy coding I had picked up in high
school). Whether or not I was always disciplined going forward, I've often
felt the nudge to take a deep breath and think a bit more because of the image
of Matthias speaking so emphatically about these things in my mind.

~~~
nickpsecurity
To see it done with imperative style, check out Stavely's write-up or book on
the Cleanroom method:

[http://infohost.nmt.edu/~al/cseet-
paper.html](http://infohost.nmt.edu/~al/cseet-paper.html)

I'd like to see a HtDP/Racket attempt at Cleanroom to see what differences or
similarities there would be. SPARK Ada and miniKanren, too. It's already
closer to them with its algebraic style of specification of programs that use
only a few primitives for easier analysis. Edit to add that what
DonaldPShimoda describes is exactly what Cleanroom required with its "intended
functions."

~~~
vram22
Had a look at the article you linked to, thanks for sharing.

I've done some work (in projects, not academia) on trying to create low-defect
software - by informal methods, not formal verification, so the paper was
interesting.

------
mpfundstein
seems like an interesting addition to SICP. Anyone here who already worked
through it?

~~~
brudgers
Back in 2013, when Coursera was free, Gregor Kickzales taught _Introduction to
Systematic Program Design_. It was based on the principles in HtDP. The videos
can be found on his YouTube channel:
[https://www.youtube.com/user/gregorkiczales/videos](https://www.youtube.com/user/gregorkiczales/videos)
That class has since morphed onto Edx. It is now part of the Edx Software
Development "micro-masters". [https://www.edx.org/micromasters/software-
development](https://www.edx.org/micromasters/software-development) The origin
of all those courses is Kickzales' teaching at University of British
Columbia...and the PLT Group centered at Boston University.

In comparison to SICP, HtDP is slower paced and more basic in terms of
Computer Science. Not surprising since the intended audience of SICP was MIT
undergrads rather than those more toward the middle of the high school
academic Bell Curve. The other major difference is that HtDP is a specific
methodology utilizing specifications, tests, stubs, and other techniques for
writing programs.

In terms of Books as Books, SICP is better written. It has far better type-
setting and binding. It is a pleasure to read. And to hold. HtDP has a poor
physical format and below average typesetting for a textbook, it's just ugly
and awkward all around. HtDP doesn't reflect a Knuthian concern with
typesetting and the experience is closer to a bound website than TAoCP. =

~~~
samth
Are you thinking of the print edition? Both books are typeset using TeX, and
both are printed by MIT press, so this is a pretty surprising claim.

~~~
brudgers
By "books as books," yes, I mean the print editions. The first edition of HtDP
specifically since that is the one I own. By "typesetting" I mean the entire
process of producing a physical artifact from an edited manuscript. Thus, I am
including aesthetic considerations such as typography, cover design, and
binding.

TeX is a technology. In the context of my literary criticism, citing TeX and
MIT press is analogous to "styled with CSS and hosted on GoDaddy" in regards
to a website. TeX is a tool. MIT Press is a good publishing house and its
catalog contains quality, but some of its books are still better than others
in terms of typesetting (in the sense described). The differences can reflect
authors' goals; publishing economics; and just the times (HtDP came about in
the era of the commercial web).

Personally, I find the unconventional physical format of HtDP (8" x 9")
awkward. It's unbalanced. The pages are too wide. The compensating increase in
font size makes the lines so tall that there is low information density on
each page. As a reader, the amount of head/eye movement for a disrupts my
concentration. The gutters are far too wide. I suppose that the wide gutters
were to accommodate the Lambda icon, but these peter out in the first quarter
of the book. Because these could be taken away with little effect their
inclusion is a decision that could have been revisited and a more conventional
layout considered.

The typography is haphazard. Code on page 191 uses san-serif. Code on page 322
is set in four faces; a mix of serif and san-serif, bold, and italics; and
boxes. Page 299 has its own notation. Often its complexity obscures the big
ideas: on page 278 the unimportant ideas are in bold (local is irrelevant to
the local point of _f_ 's referent) [1] and the diagram's arrows connect the
thinnest term and the thinnest term is typeset in _italic_.

Please don't take my remarks personally except in so far as I think HtDP is a
book worth owning and reading and that the world is better for it existing in
its current form. It's useful and supports an important project that I like.
Thanks.

[1] Page 279 uses nested boxes to express locality. These have semantics
distinct from boxes on page 322.

------
dtx1
has anyone got a PDF or EPub of this?

~~~
FranzFerdiNaN
This was posted on Reddit last week:
[https://my.mixtape.moe/bnkrpd.epub](https://my.mixtape.moe/bnkrpd.epub)

Works fine.

~~~
macintux
Crashes iBooks on my iPad, unfortunately.

