The paper examines the problem of improving programming learning through optimization of reflection accompanying the writing of software code. Reflection, as control of the logic of thinking, is an important mechanism of critical thinking in educational and professional activities. The purpose of this research is the formation of optimized, conceptual, concise schemes of reflection, which will allow to successfully cope with the tasks of educational practical programming. To realize the goal, an analysis of educational practical activities in programming was carried out in the context of their reflection on the example of creating a computer model of a simple physical phenomenon. The choice of programming as an activity for analyzing critical thinking reflection is due to the fact that this activity is well formalized. The essence of critical thinking reflection is revealed here in a refined and transparent form. Modeling gives the thinking process its own contrast, because in mental activity, in addition to algorithmic senses, additional physical ones also appear. Programming a model of a physical process here is a kind of research ground. Reflection is considered through the prism of cyclical mental processes in terms of formal logic with reference to the evolution of the structure of declarative knowledge. The final instance of this analysis was the formalization of reflection actions in laconic schemes, both the processes themselves and the structure of knowledge. An important part of the work is the connection of mental actions with the corresponding materialized activity. This relationship was also succinctly depicted on the corresponding diagram. The clear, short, expressive formalization of critical thinking actions presented in the work, in connection with materialistic actions, in laconic schemes could be used by education seekers to optimize learning and form protocols of abstract-logical and cause-and-effect thinking. The developed reflection schemes can be considered as a methodical means of learning that allows you to avoid cognitive traps and optimize educational activities both in the field of practical programming and in natural fields of knowledge, where practical actions to create or debug artificial objects of high complexity are expected.