Psychology is a diverse discipline that involves the scientific study of behaviour and cognition. As part of undergraduate training in psychology, students are required to develop substantial skills in research methods and critical thinking. Here, I will discuss our recent efforts to use computer programming to aid in the student achievement of such outcomes. We have introduced a programming component in two third-year undergraduate psychology courses. As part of 'Vision & Brain', students learn to use Python (particularly the package 'PsychoPy') to implement their own vision science experiments. As part of 'Research Internship', students learn to use Python (particularly the 'numpy' and 'veusz' packages) to perform data analyses and to produce visualisations. The aim of these new course components is to provide students with a set of skills that will increase their ability to conduct research, but also to increase their problem solving and critical thinking skills through the process of coding. I will discuss our educational and practical implementation of such material and will use the results of student surveys and feedback to evaluate their effectiveness. Finally, I will discuss some of the challenges we encountered and give some indications of potential future developments.