Writers being paid 'by the word' is kind of a misnomer. Many writers are paid more for longer pieces - reflecting the author's investment - but writers are never paid to pad or extend their work.
The confusion seems to be mostly relevant to journalism, where word count is important because space in a magazine or newspaper is literally limited. When an author is told she will make $250 on a 1,000 word article, one might say that she's being paid 25¢ per word, but she won't make an extra $25 for turning in a 1,100 word article. In fact, her piece could even be rejected if she misses the word count. See How Freelance Journalism Pays for more details. (Incidentally, this confusion is responsible for the myth that Dickens was paid by the word.)
When it comes to books (including tech books), authors are paid with a royalty system. It works like this:
- An author pitches a book to a publisher.
- The publisher and author agree on an advance payment to the author that will ensure the book will be completed. The amount of the advance is related to the time and investment required on the author's part, and the expected return once the book hits shelves.
- The book is published (hopefully).
- For every book sold, call a (small) portion of the sale price a 'royalty'. Initially, these royalties go to the publisher to refund the advance paid to the author in step 2.
- Once the advance has been paid back, the author herself receives any remaining royalties for the life of her contract with the publisher.
It should be obvious that this system yields better books than any kind of pay-for-quantity system. I would be hard-pressed to believe that authors have ever been paid for the quantity of their writing, except in the sense described above. To hear more about the royalty system in use today, here are some articles by recent tech book authors:
(All of this stuff applies equally well to non-tech books, too. If you're interested in the nitty-gritty, a conversation about self-publishing between Joe Konrath and Barry Eisler - who recently turned down a $500,000 advance - makes for pretty fun reading.)