When my cursor in middle of a word, and I want to yank the whole word, I must press b first, and press yw to yank it.
I want to know
You can use yaw. As a side effect, this will move the cursor to the beginning of the yanked area.
For more information, see Text object selection in the Vim documentation.