The objective of this research is to present and support the implementation of a teaching methodology based on active learning in a programming course taught to students of the first year of the civil engineering career. The active learning techniques used are project-based learning and collaborative learning. The research methodology is the study of three cases. The application of this methodology is supported by the increase in the percentages of achievement of the learning results obtained by the students of the same course in which this methodology was implemented (academic year 2015), to the detriment of students where a traditional methodology of teaching was applied (academic year 2013-2014). To evaluate the achievement, formative and summative evaluations were used by the teaching staff (heteroevaluation), and a self-assessment was implemented at the end of the course as well. From the obtained results it is evident that, when applying an active methodology, the students increase their achievement in each learning result; they reduce the gap between their perception of what is learned and the evaluation of teachers; and they improve their attitudinal skills (self-learning, teamwork, development and presentation of reports), among other benefits.