Again from actual experience. It was not quite programming but a guide and howto on Electronic Data Interchange, EDI, so it had a wider market but was still in the technical sphere with a lot of detail on standards.
I wrote it in my spare time so didn't lose out on wages but i had added costs for hardware software and research. I was lucky (very lucky) as i did it as a flyer but i picked up a publisher immediately and in the end sold a lot of copies and made quite good money,
I found the publishers hard to work with and ended up doing most of the promotion myself.
I found the time/remuneration ratio not that good, or at least not good enough to do it again.
I found having an ISBN number on my CV invaluable when going for jobs in the Academic arena "Oh we see you have published? Very Good"
From the book i picked up a very lucrative contract to write almost the same again for a branch of the UN (UNCTAD), again CV as well as real experience enhancing.
And it is nice to be able to look yourself up on Amazon even if as i was at one point 1.5 millionth on the best seller list. This must have put almost every other book then published in front of me.
If i had to sum up and give some advice it would be
- do it if you feel you have to anf if you can get a publisher (i was just plain lucky)
- Don't count on it making you a fortune, even many famous writer have second jobs
- If you can do it , do it as it is experience and may lead on, like mine, to other opportunities
To finish with an anecdote. A couple of years later i was applying for a job with a company that had bought two copies of my book and they asked what made me feel that i could do the job, so i pointed out they had thought enough of me to by my books! Wow. Actually didn't get the job though.
The book was call Edication. And was actually an eBook in that i wrote it with Asymnetrix\s ToolBook product and so it ran on pc's in hypertext about two years before the WWW hit the streets.