I certainly wouldn't discourage anyone from doing this. But there's some cachet to having your name on a book cover compared to being an unsung writer of docs. (Self-published vs. through a publisher is another more complicated discussion with both pros and cons on both sides.)