Two complementary processes may be distinguished in learning a complex cognitive skill such as computer programming. First, automation offers task-specific procedures that may directly control programming behavior, second, schema acquisition offers cognitive structures that provide analogies in new problem situations. The goal of this paper is to explore what the nature of these processes can teach us for a more effective design of practice. The authors argue that conventional training strategies in elementary programming provide little guidance to the learner and offer little opportunities for mindful abstraction, which results in suboptimal automation and schema acquisition. Practice is considered to be most beneficial to learning outcomes and transfer under strict conditions, in particular, a heavy emphasis on the use of worked examples during practice and the assignment of programming tasks that demand mindful abstraction from these examples.