I guess the ideal situation is to work on something that requires little collaboration, but such positions are very rare.
EDIT: They're even more rare that they could be. In cases where a component could be reasonably written and maintained by a single person, managers will still usually impose a requirement of having at least two or three people involved with that code, which creates large and completely unnecessary communication overhead. The reason is of course they don't want to be dependent on this specific programmer, because then they would have to pay market or above market wage and generally create a developer-friendly environment. They think that it's easier and cheaper to treat developers as replaceable cogs, even if it means they have to subject them to excessive knowledge transfer, thus making them less productive.