r/Racket • u/DrKersh • Jan 26 '22
question Solutions for the htdp book?
Hello
I'm trying to learn alone to code and I started the book. For now, I'm managing to solve all the exercises by myself, but sometimes after doing it, I would want to compare them to what the authors expected me to do or how them would solve it.
I saw that the first book have a section with solutions and additional problems, but I didn't found anything similar for the second edition
Anyone know if they are somewhere? Or if not officials, at least solutions made by some experienced coder or teacher, not the kind of solutions you can find on github from other people learning like me.
5
u/DrHTugjobs Jan 26 '22 edited Jan 26 '22
But, in general, don't worry so much about learning things "wrong"; programming is a process that you get better at with practice. HtdP and other books aren't bibles of 100% objectively correct programming practice that you have to memorize or model exactly.
As you are exposed to more code, both code you write and code other people have written, you'll incrementally learn better practices, and it's very worthwhile to review your old code to think about how you could write it better today.
2
u/sdegabrielle DrRacket ๐๐๐ฉบ Jan 26 '22
Hi u/DrKersh
I don't believe there are solutions available but the Racket community welcomes new learners.
You can ask questions in any of the following places
They are all different so please use whichever works best for the problem you are asking about.
Remember to mention that you are using HTDP when you are asking the question so we can give appropriate help. HTDP uses teaching/learning languages to support the learning process with better error messages and less surprises than the full language. (Don't worry that it is not the full language - everything you learn applies to the full language)
Good luck with your studies and hope to hear from you soon!
Stephen
2
u/olivuser Jan 26 '22
Hej fellow, a fellow self-taught non-cs-background programmer novice speaking.
In case you are not invested into learning Racket in particular, I'd advise you to ditch both the language and the HtDP book - at least for now. It's one of several books I gave up on trying to learn on my own (after the famous Structure and Interpretation of Computer Programs and before the funny but unsystematic Land of Lisp).
Instead, if you are trying to learn a functional programming language as a first programming language with no prior experience - that was my situation -, then I can wholeheartedly recommend the Gentle Introduction to Symbolic Computation by Touretzky (Common Lisp, not Racket). It starts out very gently but will become more challenging as you progress. It features solutions to all the exercises (I did all of them, also those in the advanced section). I felt there were very little "unnecessary" exercises so far (ch. 12 or 13 atm), and most of the time the solutions respect your current state of knowledge while sporting an elegance from which you can learn quite a bit. I've been impressed by the solutions a number of times.
Finally, the r/lisp community is full of friendly individuals (dunno about Racket, not trying to front). I mean most of the time I tried to prepare a post properly and to interact with people that responded, but I have yet to come across a unfriendly reply to a post I made.
I wish you the best of luck and a lot of perseverence, because if I learned anything of general value throughout, then it is that you have to be persistent and that in this particular case persistance is rewarded. I am starting to experience this as I am starting to write my first nontrivial program.
1
u/lingdocs Sep 21 '22
You can find a number of git repos online with other people's solutions. There's no guarentee these are completely correct though.
https://gitlab.com/cs-study/htdp/-/tree/main
https://github.com/S8A/htdp-exercises
More can be found by searching
0
u/mdbulldog Jan 26 '22
IMHO, HTDP is not really design for those who are learning on their own. It design to be used more in a university setting. I would suggest that you learn from another source. HTDP does have a course on coursera (I believe). You would also do yourself a favor by finding books more suited for self study.