PurposeIn a technological era driven by coding, programming and artificial intelligence (AI), there is more need than ever to develop computing skills and knowledge for non-specialist students. Nonetheless, the literature on computer science teaching methods of non-scientific majors is not as comprehensive as that of scientific ones.Design/methodology/approachPedagogically, the authors designed and implemented prototyping from John Dewey's pragmatic epistemological lens. Using a mixed methods approach, the authors tested the effectiveness and efficiency of this approach within the same course over four semesters across four academic years.FindingsAs an epistemological pedagogic device, prototyping facilitated learning by doing and experimenting and stimulated graduate students' self-directed learning, engagement and their overall ownership of the learning and teaching process, changing their role from being merely passive recipients of “strange, awkward and unfamiliar” knowledge to active constructors of “relevant and exciting” content knowledge. Such a change was reflected in the significant progress students made, driven by their commitment, motivation and enthusiasm, irrespective of their prior knowledge and age (Generations X, Y and Z). Prototyping also served as an avenue for a “Deweyian Reflection”, where graduate students, after internalizing the acquired computing skills and knowledge, started transferring such skills and knowledge to their professions (journalism and public relations (PR)) and daily practices.Research limitations/implicationsFindings from this study will add to the literature review on this subject matter and will inform future case studies in computer science education for graduate students from non-scientific backgrounds.Practical implicationsThis paper reveals that learning by doing/experimenting needs to be accompanied by in-depth reflection to enable students to transfer the acquired knowledge and skills to other settings and contexts beyond that of the lesson, task, or project in hand.Originality/valueThere is little research published on introductory programming courses offered to non-specialized students (i.e. students from non-scientific backgrounds). This study contributes to the body of research on how to effectively engage these students in programming courses informed by John Dewey's pragmatic lens/epistemological lens.