My two cents from my own experience:
No programmer ever gets stuck. They just tend to go off on "development tangents"tangents. Research and development tangents.
The best way to ensure that they don't go off on tangents is to separate the role of the lead programmer from the role of the manager: the lead programmer is usually someone very gifted who would rather be coding than managing other programmers. The manager needs to be someone who does little, if any, coding, and his job is to be constantly coaching the team.
That's because when left on their own, programmers tend to be oriented exclusively towards the engineering aspect of their jobs, (engineering lust?) with relative disregard towards project goals. So, it helps to have someone reminding them that there is a project to complete.