My Scheme Blog (19, permasaged)

7 Name: SchemeNoob : 2009-07-18 20:41 ID:97UmOfTm

>>4

Whatever. I guess I am breaking the mores of this board. I called it /prog/ big deal.

Anyhow, I am working through HTDP after some recommendations from other people that are more experienced. One gripe I have with HTDP is the examples. They are retarded but the book teaches well. I skipped the theater ticket profit calculator because the way the author calculates the number of attendees for the theater based on ticket price is stupid. I would calculate the attendees in the following toy example:

(define (attendees nightly-revenue ticket-cost)
(/ nightly-revenue ticket-cost))

The author has a bunch of hard coded values and bases his calculation on the assumption that a price of $5.00 will always net 120 people and that a decrease of .10 will always increase that number by $15. My understanding of software development is that we should make things as general as possible so we can reuse our code. The author will have to edit his code when he finds that there is a change in the market trend (economy or otherwise). I will not, I will always be able to get the number of customers I had no matter how the market changes.

I also went and bought The Little Schemer so I can read it on the subway.

This thread has been closed. You cannot post in this thread any longer.