On Mon, Jul 8, 2013 at 9:41 PM, Ben Duan <yfe...@gmail.com> wrote: > Dear All, > > I have a question here. There’s an extensive use of comments in HtDP. But > there are few comments in experienced programmers’ code, for example in > racket’s source code. Why is that?
I think the claim about experienced programmers code is incorrect. In Typed Racket, the code I'm most responsible for, more than 10% of the lines of code have comments on them, and there are other places where the code itself is written to include its specification, such as using contracts. Certainly, there are parts of the code that are under-commented. Mostly these are places where the needed comment is an in-depth explanation of design decisions, or discussion of the implementation choices behind a particularly tricky bit of the system. These aren't the kinds of comments that HtDP focuses on, but that doesn't make them any less necessary. Unfortunately, they're often easy to leave out in a hurry to get something done. Sam ____________________ Racket Users list: http://lists.racket-lang.org/users