[plt-scheme] HTDP: Question on 7.4.4

From: Grant Rettke (grettke at acm.org)
Date: Thu Sep 11 23:58:34 EDT 2008

Hi,

In 7.4.4, in each of the cond clauses I've got the question and answer
"all there". In other words, I didn't break out clear-circle and
clear-rectangle into separate functions. Since their bodies are tiny,
I didn't see the point.

One of my friends working through HTDP countered saying "Follow the
advice of the book; break out complex code into separate functions."
He didn't say it yet either, but I bet he'll say that it is easier to
unit test, too.

I feel like conceptually, I don't want to expose those because I
followed the approach of exposing the clear-shape function "function
per class approach" versus using a bunch of individual functions, the
"function per sub-type approach".

Perhaps I am over-thinking this at this point.

Best wishes,

Grant


Posted on the users mailing list.