Use (thing-at-point 'symbol) seems better because underscore, which is used very often in many programming languages, is not a word character.