I would recommend everyone look at xspace.
It only has one tiny aim - to deal with spaces after commands.
Given: \newcommand{\S}{Bob} then \S is \S. expands to:
Bobis Bob.
While: Given: \newcommand{\S}{Bob } expands to Bob is Bob .
One can write: \newcommand{\prog}{\textsc{prog}\xspace}. Then we get: Bob is Bob.