I am in the final stages after over a year and half. I was in your position not too long ago and researched as much as I could before accepting, so I will skip things you will find in a quick Google search.
Negotiating:
1. Everything is negotiable, remember that
2. Under promise on #pages, they ask you for an estimate but lowball it because thats how they price it and then will ask you to fill it.
3. Get in writing what they will be contributing.
Choosing the topic:
1. Choose a topic you are passionate about
2. Choose a topic you know a lot about
3. Choose a topic you can write a lot about
4. Don't be afraid to tweak the topic half way in.
5. Choose a topic that will sell in a year and half.
Writing the book:
1. Write an outline, write the first chapter, throw it away, and rewrite the outline agin.
2. Its better to lose work than to keep going in a direction that isn't working
3. You'll be busy but be reading other books as much as you are writing.
4. Wake up early or stay up late, 0 distractions is the best for writing
5. Talk out loud, like youre presenting to an audience to get unstuck from writers block.
6. Get feedback as soon as possible.
Marketing the book:
1. If you can, get in writing what marketing they will do for the book.
2. Negotiate on how many free books you can get to give away
3. Sales on Amazon are important, direct sales there, esp on launch day.
4. Start a newsletter (yay more writing!)
Other:
1. This is a second job
2. It does open a lot of doors
3. Consider a co-author for your first book. I added one towards the end and wish I had done it sooner. Its easier to collaborate and bounce ideas off each other and keep each other accountable.
I actually cover this story in my book Tragic Design
(http://shop.oreilly.com/product/0636920038887.do)
In my opinion, the software bug wasn't to blame but bad user interface design. When the error occurred that caused patients to get a direct blast of 10x rad more than what were supposed to get, the error was caught and displayed. But because there were so many erroneous errors, users were used to bypassing them. I go into much more detail in the book but I thought I'd chime in here. What do you all think?
For those interested in more: http://shop.oreilly.com/product/0636920038887.do