Computer programming is a difficult subject for most novice programming students which leads to a high rate of dropout or failure. Flipped classrooms have been increasingly used to teach programming students to practice their programming skills in the class based on their knowledge acquired from outside the classroom. This study investigated students’ learning achievement which was measured by their performance on a coding test and an exam. We compared students’ programming test scores of the traditional classroom in semester 1 of the academic year 2016 with the flipped classroom in semester 1 in 2017. In addition, we studied students’ perception of flipped classrooms in a structured programming course. The population of this study consisted of 69 second-year students of the Information and Communication Technology programme in the Faculty of Science, Prince of Songkla University, Thailand. The research instrument for investigating students’ perception of flipped classrooms was a questionnaire. Students were positive in their perception of flipped classrooms and agreed that in-class activities improved their understanding of concepts. Moreover, students in the flipped classroom environment had a significantly higher test score compared to students in a traditional lecture class.