[Index of Problem Sets]
Problem Set 06—Notes and link to solution
Here are some general comments about Problem Set 6.
At some point in the course each of you needs to transition
from following the recipe to actually using the
recipe. Some of you already have. But at this point in
the course we start to see a symptom of just following the
recipe start to crop up &emdash; when the problems get hard some
people start dropping recipe elements. For many people that is
problem set 6.
Remember, you were never writing the recipe elements for us. You
were writing them so that when the problems get hard they would
be there to help you.
-
We write the signature first because it really helps
to be clear in our minds what type of data the function
consumes and produces. If it isn't completely clear to you
then you can go past the signature and come back, but don't
ignore the signature!
-
We write the purpose next because it really helps to
start crystalizing more about what the function produces.
-
The examples which will LATER become tests
also help us get more clear about what the function does. The
harder and more confusing the function is the more time you
should spend on the examples. For really hard functions you
might spend hours on the examples before going on to the
template.
-
We don't any longer require you to write an @template as part
of the function design, but you very much still should figure
out a template origin strategy and write a template. Ignore
the template is like saying ``No, I'm not going to bother
thinking about what this function has in common with other
functions, I'm just going to start banging away and see what I
come up with.'' The harder the problems get the less well that
approach is going to work.
So the main feedback on problem set 6 is that it was much
easier to do if you allowed the recipe to help you get
there. Remember that, going forward the problems become much
harder especially in modules 9, 10 and 11. You learned the
recipe so it could help you &emdash; let it!
The solution for this problem set is: