Touch of Class book page available
The book page for Touch of Class (my introductory programming textbook), announced in the book, is finally available, courtesy Vladimir Tochilin:
It includes some book extracts (prefaces, table of contents, an entire sample chapter, for which I chose the Recursion chapter), a list of known errata and a wiki page to report new errata, a discussion forum, links to the full set of slides (PowerPoint, PDF) for the associated course, video recordings of that course at ETH, and a special “instructor’s corner” for those having adopted the textbook for their courses.
First, thanks for the link to the “do you really know Java?” discussion.
Second, thanks for the link to the sample chapter on recursion. I’m looking forward to studying it in detail.
Third, as someone who doesn’t even qualify as a beginner in Eiffel, I was surprised by the statement on page 440 (of the sample chapter) that “The following function indeed yields the same result…” in one case. Is fibonacci1(0) actually allowed, given the requirement (n >= 1)? Or is the problem my own ignorance of the meaning/usage of “require positive: n >= 1”?
On the third point: the two functions yield the same result when they are both defined (i.e. n >= 1). This is implicit but in the next printing I will make it explicit to avoid any confusion.
I first thought you were referring to the loop invariant, but it is correct — it mentions fibonacci (i-1), which is always defined, not fibonacci1. Of course it would make no sense for a loop invariant to use the enclosing function.