Learning computer programming has become an essential skill in the digital age, presenting significant challenges and opportunities for students. This study examined the levels of motivation and perceived self-efficacy as factors in the initial learning of computer programming and their possible correlation with the academic performance of Computer Science students at a university in Puerto Rico. The approach was quantitative, using a survey research design (cross-sectional), with a self-administered online questionnaire. Evidence of validity related to content, response process, and internal structure was collected, and a non-probability convenience sampling was employed. The data were processed using the SPSS statistical package. The results showed a significant positive Spearman correlation between the items of the self-efficacy and motivation subscales with the academic performance reported by the participants in the introductory programming course. The study concluded that the self-efficacy and motivation of programming learners positively affect academic performance, contributing to the development of higher-order thinking skills such as problem-solving and creativity, highlighting them as fundamental factors in the initial learning of computer programming.