This study develops and empirically evaluates an Adaptive Gamification Design Model (AGDM) to address programming learning difficulties (PLDs). A three-phase mixed-methods design was employed. Phase I used a PRISMA-guided systematic review of studies published from 2010 to 2025 (N = 112) to construct a multidimensional Programming Learning Difficulty Taxonomy (PLDT) encompassing cognitive, affective, and instructional challenges. In Phase II, the taxonomy was validated through exploratory and confirmatory factor analyses of survey data from 842 undergraduate computer science and software engineering students at four public universities. Phase III comprised a 14-week quasi-experimental intervention involving a control group (n = 142) and an adaptive-gamification group (n = 144). Cognitive load, syntax anxiety, and self-efficacy deficit significantly predicted course failure. Compared with traditional instruction, the AGDM environment produced higher academic performance and intrinsic motivation and reduced the dropout rate from 34% to 12%. Structural equation modeling indicated that engagement and self-efficacy mediated the relationship between adaptive gamification and academic performance. The framework is operationalized through the Adaptive Gamification Optimization Algorithm (AGOA), which dynamically adjusts task difficulty, feedback scaffolding, and motivational incentives according to each learner's PLDT profile. The study contributes a validated taxonomy and a scalable adaptive-gamification framework that can be integrated into computing curricula to support competence, retention, and personalized learning.