Errata in Programming Books?
WgT2 asks: "I recently have set my mind to learning to code PHP. Not being a programmer, yet, I went out and got myself a book on the subject from a very trusted, at least in my eyes, publisher (and they still still are). So far so good. However once I got down to trying the code out myself I have found too much errata for someone who has just scratched the surface in learning the ins and outs of programming. I was wondering just how common place Slashdot readers have found errata in the code examples of programming books they have purchased?"
Why don't they care?
Bill
Also the chapter on pointers sucked ass.
bamph
Tough subjects, tight deadlines, and the profit-first additude lead to bad books.
I recently purchased Learning Java from Oreilly. Usually I've had a good experience with Oreilly books, but this one was horrible. Several of the examples in the first chapter of the book didn't work because they had typos!
Few things are more frustrating then debugging a "Hello World" program that doesn't work. I went over every character, bit by bit, and my program matched their text exactly. I couldn't find the damn bug. Was I so stupid that I couldn't see the obvious? No! I viewed the Online Errata, and found that a zillion other people were having similar problems with examples throughout the book! Typos galore!
If there are too many mistakes in the book, then let the publisher note. Return the book, get your money back, send a note to the publishers, and buy an alternative book.
"Can of worms? The can is open... the worms are everywhere."
Don't learn PHP first; you'll just join the ranks of amatuer programmers making webapps that get 0wned. Learn perl or Java or C. Somehow, PHP just always seems to make for shitty coders.
Many (most?) books publish errata on their web pages or on their publisher's site. I've even got a few books that had printed errata folded up and stuck into the cover. I don't mind seeing a reasonable number of errors in a book, especially a very technically dense book, as long as I see that the author and/or publisher makes the errata sheets easily available. After all, we're all only human.
Check out my eclectic infosec blog at InfoSecPotpou
I was wondering just how common place Slashdot readers have found errata in the code examples of programming books they have purchased?
I'm not really the most commonplace of Slashdot users, but I usually find errata by looking on the book's website, or trying the code. I suspect the more common-place of slashdotters use the same strategy.
--Dan
Someone has to make a Knuth joke. I tried, couldn't come up with anything. Come on people!
Here's his errata.
My favorite is the Random Number error. It took a while, but someone discovered that apparantly one of the portable random number generators behaves poorly during the first 2000 or so of each seed number. So, naturally, Dr. Knuth corrected it almost immediately.
Never have I seen a man so humble that so amply deserved to be arrogant...
I learned more debugging the errors in the printed code than I did in reading the frigging book.
Twisted, huh?
The book I wrote had quite a bit of errata with some simple topics, and not much on the hard topics. I simply didn't spend enough time on the first half of the book, and I regret it.
:-(
What really killed my time was adding more content to the book than initially planned. I should have left it all out, but at the time I thought I had the rest of the book nailed down. I should have spent more time reviewing, and getting more feedback from the reviewers.
If any of you write a book, be sure to stick to the initial plan, and do no more. You might even want to cut out some of the content... don't just write to add more pages to the book. That is one thing I hate about Wrox books, imho, and I did a little bit of that myself
Of course, there are always second printings, and second editions to incorporate the fixes, but that doesn't fix the disappointment of finding the errors in your own book the first time around.
More often than not, it is the editors who are at blame rather than the authors. First off, my bride was a technical writer. I'm still not quite sure what that means, but as an English / Math double major without any coding experience, some of the results were quite comical. A while back she was fixing the Engrish descriptions, code fragments, sql scripts, and a mix of other stuff. She went back to the developer because they possibly misspelled pseudo as sudo. She had the sense to not 'spell check' the scripts, but another friend who wrote a Perl book said his editors were not quite as thoughtful.
+++ UGUCAUCGUAUUUCU
Or learn perl or c or java so you can join the ranks of people that answer a question like "I was wondering just how common place Slashdot readers have found errata in the code examples of programming books they have purchased?" with "Don't learn php".
You'll have that sometimes...
So you can learn how to debug.
I haven't done any programming in over a decade. I recently had to start learning a lot of new information and bought several stacks of books. I found the O'Reilly books to be VERY helpful. In the past I always found Sam's to be informative and helpful as well, but I found Sam's MySQL in 24 Hours to be rather frustrating because of little errors here and there.
Above and beyond the errors, I don't know if it's because the book is a "in 21 Days" format or not, but I've found it rather frustrating and useless in the long run because it does not work well as a reference book and it seems there is A LOT that has been left out.
I will not likely buy another book in any "in 21 Days" or "in 24 Hours" or any similar format again. While they may provide a quick intro, it seems to be a week format if you plan to continue in the subject.
Publishers should hire college geeks to proof code
The original K & R C guide was legendary for it's coding errors.
Perhaps slashdot posters should hire college English majors to proofread their posts.
Let's face it, we all make mistkaes, even K&R. But The C Programming Language, has been continuously read and referenced by newbie and experienced coders alike since 1978 -- for twenty-five years.
Apparently it's legendary for more than just what you dismiss as "coding errors".
Opinions on the Twiddler2 hand-held keyboard?
I had to learn Java quickly, and I used the same book. The programs I tried worked for me, although I did skip the programs in the first couple chapters.
I absolutely love the book. Your mileage may vary.
what???
http://www.archive.org/details/ThePowerOfNightmares
He's complaining about too much errata? Knuth's $2.56 checks were my goddamn college beer budget!
I don't know which book you got, but O'Reilly's Programming PHP has its own confirmed and unconfirmed errata pages. If this is the book you've got, feel free to go over the corrections noted on these pages and jot them down in your copy -- I've done that with a couple of my books, and would have missed many of the glitches without that hint. If you see an error that isn't on this page, O'Reilly offers a error submission form that you can use for that book (and others of course) -- so use it! If the publisher doesn't find out about these mistakes, they aren't going to get fixed. A good publisher will offer revised printings -- not that that helps you once you've got a copy, but it will prevent other learners from having to hit the same obstacles you did. :-)
You can't, unfortunately, expect books to be perfect & pristine. (Well, maybe Knuth's books, but everyone else has to deal with typos & thinkos :-). You can, however, and should expect the publisher to own up to their little mistakes and offer you corrections on their site. Go find that info and get the fixes into your copy and you'll be a happier camper.
DO NOT LEAVE IT IS NOT REAL
bleeve that's intended to be a wrenchingly misguided pun on 'erotica'...
Believe me, I've spent my fair share of time and frustration trying to debug bad examples. It took a long time to learn, but when I don't trust the author, I find that the errors are more challenging than frustrating.
A couple of O'reilly books in particular, Steve Oualline's Practical C Programming and his Practical C++ Programming purposely have errors in the examples for just this reason.
The difference is, Steve tells you that the errors are there. It's a good learning technique, and forces you to pay attention to the concepts rather than the examples.
Notes From Under *nix: blas.phemo.us
Errors in book happen all the time, but it seems like translation make it worse...
I own a couple of coding books translated in french - it's even weirder. Sometimes the variables in the code get translated, sometimes the step-by-step explanations get out-of-sync and the variables change names, well you get the point.
Do translators know they're translating code or are book businesses really hiring cheap labor?
Then, after reading stacks and stacks of books and lines and lines of code that talk about arrays, floats, strings, you find yourself faced with tableaux, nombres à virgule flottante, chaînes de caractères. It just doesn't feel right.
I mean, it's like translating a russian-chinese dictionnary in english!
Recently, I got the O'Reilly Struts book. I was astonished to see that all the screen shots were taken on Windows! Now, this may not seem absurd to the younger generation, but I was reared on O'Reilly books that were decidedly ... non-Windows oriented. Yes, you could use Windows, but only to get to a Real Computer. A Real Computer, of course, was one that ran UUCP out of the box. Anyway, I was surprised. Suppose it was foolish of me to be, but I was.
"He who would learn astronomy, and other recondite arts, let him go elsewhere. " -- John Calvin, commenting on Genesis 1
As a big reader (and reviewer) of technical books, they usually aren't much of a problem for me as material I already know can patch the code (and usually it's as basic as misspelling a keyword of something trivial like that).
I've never once had to look up errata for the book because of coding errors (although for a couple of Wrox books that had pages and pages of code, I couldn't be bothered debugging the code and downloaded it).
my favourite thing is when the errata page has fixes to errors that aren't even IN the book. Ugh.
A thought - it might be better to buy a book that is a second or later edition, rather than a first. My reasoning is that 1) the book was good enough (or at least sold well enough) to justify more than one edition, and 2) errors in the previous edition may be more likely to have been corrected in the subsequent edition(s).
For sure, check that the book (and the edition you're looking at) has an errata page at the publisher's (or author's) website before buying.
Grok?
Bill
bamph
Several years ago I bought Java for Dummies, the first edition of the book. I don't believe I ever made it past the 3rd Chapter or so because only about half of the Code Examples were working correctly. It was so bad, I dropped Java and went back to C and have only recently tried another attempt at Java. I even tried the CD that came with the book and several (although not as many) of the examples on that did not even work. I ended up throwing it all away and I haven't bought a Dummies book since.
-> Fritz
Spooooon!!!!!
I had a Pascal Text book in college, that was riddled with errors. Syntax, logic, bugs, overflows...the code samples were just nasty...
The worst part is it was very appearent that the professor had no idea, since she just rattled off the same mistakes as part of the lecture.
Luckly I had already had Pascal in high school with a good instructor...I flew through the class while others struggled due to the crappy book...
Power Corrupts,Absolute Power Corrupts Absolutely, leaving one person(group)in charge is absolutely corrupt.
Personally I have come across few typing errors in books (then again I RARELY try any of the code they offer in books). I personally have several PHP books and if you are just starting to learn PHP please be aware that the language goes through like 4 updates a month or something like that. I remember when I first tried to learn PHP I attempted some of the code and it would not work. This was because from the time the book was published to the time I got it the PHP language had changed. Some of the defaults were changed etc... so things did not work the way i intended them to (changing it so all variables were not global by default drove me nuts until I firgured out what was wrong).
Basically the point I am trying to make is that with PHP some times the problem may not be with errors in the code, but may be with the fact that the language has changed and no longer supports what you are trying to do... Having saying this if you cannot get a "Hello World" Program to work then I would be a bit suspicious as to whats wrong.
I find that figuring out the errata beforehand really lends to a deeper understanding of the subject matter. It is a great way to "dialogue" with the text as opposed to passively absorbing it.
And I always email the author if he asks for errors. That way he might mention me in the acknowledgements section and my googlekarma will skyrocket!
Some of these errata can ruin your career. I haven't managed to ace a PHP job interview since the great "Hello, Borld" misprint of 98. I hoping a quick scan of "Design Batterns" will rectify my buzzword potential for the next interview.
It is not just in programming books.
This same thing is fairly common in cookbooks.
Many of the recipes in cookbooks if you actually follow the directions and ingredient list exactly, would not come out right.
So when your double fudge walnut chocolate upside down cake doesn't taste right it might not be your fault.
According to K & R, all of the code in The C Programming Language has been tested from the original text. However, the minimum wage printers often removed all or parts of punctuation marks and the such, thinking they were not originally intended to be on the printing plates.
s .html
Also, K & R have an EXCELLENT errata page:
http://cm.bell-labs.com/cm/cs/cbook/2ediff
I was once a student of Rob Pike
The course notes for this subject were basically the chapters of the book. He asked all his students to read through the code examples and let him know if there were any problems. I don't know if we can claim all the credit (I found some errors in the early chapters) but this book has a very short errata page.
Mind you I can't remember a code example where they got sizeof(char) wrong!!
Democracy isn't about no one telling you what to do. It's about everyone telling you what to do.
I've considered starting up an errata directory, where readers, authors, et c. could submit their errata to be compiled into one easy-to-search database. A useful idea?
WeRelate.org - wiki-based genealogy
I'm not really a coder or developer, although I know some perl. I believe this is rather a common occurance. The examples in books are there more or less to give a reference on how you should approach a problem rather than a real working example. I seem to remember reading a C++ book in college that actually said this in the front of the book.
Hey, at least you are catching errors. You are better off than the people that did not catch them.