Despite the growth in rates of students enrolled in online courses, the data shows that online courses face the challenge of a higher attrition rate than their face-to-face counterparts. While numerous studies explored the approaches to teaching programming, few have focused on the fully online delivery mode. In this paper, we describe and discuss our approach in designing and delivering of an introductory programming course online. Drawing on attribution and self-efficacy theories, we provide a framework in which each of the main elements in our approach contributes to the attributional factors such as behaviors instigation that includes motivational behavior and learning strategy, effort, and persistence. These factors influence performance indirectly through self-efficacy.