Abstract-In learning to program, there is a complex interplay between the learning of practice (what to write, how to read compiler messages, etc.) and the learning of theory (what programming constructs are good for, how they "work", how the programme executes etc.). Our on-going project focuses on this interplay -normally not directly visible for the learners themselves -and offers insights about the complexity of the learning process. From a micro-level analysis of video films of students' collaboration in lab sessions, we follow how the students attention moves from one aspect to another (theoretical or practical), and then further, until, in good cases, we can document that a meaningful learning has taken place. Theoretically the project takes its point of departure in a framework, inspired by the roots of phenomenography and variation theory. Theory and practice are here interpreted from a pragmatic perspective, close to the students' (and, as we believe, most programmers) intuitive understanding and use of the terms. The ultimate aim of the project is to support teachers and teaching institutions to teach programming in such ways that students better learn how to program. That is, the project takes its point of departure in the disciplinary learning -the learning of programming -and aims to propose possible improvements in our teaching, by building on the insights gained by the microanalyses of the students' learning. In this paper we illustrate, from an example, how the research process leads us from microlevel observations on how the students attentions move from different aspects (both theoretical and practical) of the half-ready computer program they aim to finalize, over our analysis of the lab sessions, to some insights in the complex interplay between theory and practice in programming students' learning process.