[racket] extra exercises

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Mon Apr 16 17:18:25 EDT 2012

A good thing about exercises coming from an introductory textbook is 
that they are usually appropriate for the material instruction that the 
student has received at that point in the book.  (Ideally, there is a 
mostly linear progression through the book.)

However, if one is still looking for additional beginner programming 
exercises, I think that one not-totally-bad option is to start picking 
standard algorithms and data structures one can learn about by search 
the Web and in books (e.g, sorting, shuffling, searching, 
stringmanipulating) and trying to implement some of those.  Remember to 
make good unit test cases, and to verify your implementation both 
against your own understanding of what it should do, and against the 
output of other credible implementations you find.

When finding algorithms on the Web and in books, be aware that most code 
and pseudocode examples you'll see will have pieces like "set variable x 
to the value of x + 1", and that Racket will indeed let you implement it 
just like that -- "(set! x (+ x 1))" -- but at some point you should 
also learn to implement these algorithms functionally, without using 
mutators like "set!".  So don't spend too much time learning "set!" to 
death by transliterating every bit of code you find in every one Knuth's 
books -- instead, learn "set!", and then move on to learning how to 
*not* use "set!".

Neil V.


Posted on the users mailing list.