Errata for Learn to Program
We try to keep our books accurate, but sometimes mistakes creep
in. This page lists the errors submitted by our astute readers.
If you've found a new error, please
submit it.
The latest version of the book is P4.0,
released 4 months ago.
If you've bought a PDF of the book and would like to upgrade
it to this version (for free), visit your
home page.
| PDF |
Paper |
Description |
Found in |
Fixed in |
| vii |
|
#29979: On first page of Introduction, third paragraph begins "It has been more than decade." This should read "It has been more than *a* decade"--Brett Barney
|
P1.0
12-Dec-07
|
|
| 1 |
|
#30635: If anyone's interested, I put up solutions to the problems in the book, right here: learntoprogramanswers.blogspot.com
|
P1.0
29-Jan-08
|
|
| 12 |
|
#29986: In the third bullet-point under "2.4 A Few Things to Try":
". . . be as accurate--or not--you want.)"
should read
". . . be as accurate--or not--*as* you want.)"--Brett #29986: In the third bullet-point under "2.4 A Few Things to Try":
". . . be as accurate--or not--you want.)"
should read
". . . be as accurate--o ...more...
|
P1.0
13-Dec-07
|
|
|
15 |
#34455: You have us type:
puts ' 12' + ' 12'
Because of the space after the third quote, the output should read 12 12 but in the book it says 1212. The same error occurs below in the statement:
puts ' 2' * 5--Chris Mitchell #34455: You have us type:
puts ' 12' + ' 12'
Because of the space after the third quote, the output should read 12 12 but in the book it says 12 ...more...
|
P1.0
09-Sep-08
|
|
| 36 |
|
#29987: The marginal comment on this page is garbled:
"Modulus, much like
integer division, might
seem bizarre, but they it
is actually really useful,
often when used with
integer division."
Huh?--Brett #29987: The marginal comment on this page is garbled:
"Modulus, much like
integer division, might
seem bizarre, but they it
is actually really use ...more...
|
P1.0
13-Dec-07
|
|
| 38 |
|
#31155: The description of the code says "Note that I used rand(101) to get numbers from 0 to 100 and that rand(1) always returns 0." He's making a point there about using rand(100) would give you numbers up to 99. However, in the code example he's referring to, (bottom of the previous page) he actually uses rand(100) in the example he's referring to ... which makes this comment quite funny: "Not understanding the range of possible return values is the biggest mistake I see people make with rand, even professional programmers, and even in finished products you can buy at the store." Just goes to show that it's not always a lack of comprehension at fault. #31155: The description of the code says "Note that I used rand(101) to get numbers from 0 to 100 and that rand(1) always returns 0." He's making a p ...more...
|
P1.0
06-Mar-08
|
|
| 39 |
|
#31156: I believe that "Suffice it to say" should be "Suffice to say".
|
P1.0
06-Mar-08
|
|
| 71 |
|
#32258: This book is my first foray into any programming language, and I'm finding it extremely readable and helpful. Thank you!
The code example about "tough_var" being defined locally didn't strike me as meaningful at first... until I played around with the order of the code. The impact of local definition was made clear when I ordered it this way:
--code--
tough_var = 'You can\'t even touch my variable!'
def little_pest tough_var
tough_var = nil
puts 'HAHA! I ruined your variable!'
puts tough_var.to_s
end
little_pest tough_var
puts tough_var
--/code--
This defines the variable shown to be modified before the local method, which to my admittedly inexperienced way of thinking is a bigger deal. Since I had to rearrange the code to get the gist of the lesson, thought you might like to know.
Maybe that shows that by this point in the book, you've already equipped me with enough knowledge to be able to figure out through experimentation. :) Thanks again, I'm loving the book. #32258: This book is my first foray into any programming language, and I'm finding it extremely readable and helpful. Thank you!
The code example a ...more...
|
P1.0
03-Jun-08
|
|
| 103 |
|
#24458: Hi - not sure of this is an error, exactly. But when I run the Photo renaming utility, I get
'rename': Cross-device link - /Volumes/EOS_DIGITAL/DCIM/126CANON/IMG_2650.JPG or Animals01.jpg (Errno::EXDEV)
This is using a USB card reader on a Powerbook G4 on OSX 10.4.6--Richard #24458: Hi - not sure of this is an error, exactly. But when I run the Photo renaming utility, I get
'rename': Cross-device link - /Volumes/EOS_DIGI ...more...
|
P1.0
12-Apr-06
|
|