The recent introduction of computer programming in all Swedish school curricula is a significant addition that came along together with several revisions aiming at enhancing pupils’ ICT skills. One of the reasons behind this implementation model was to accelerate the rate at which substantial results would be noticeable. It was also expected that teaching algorithmic thinking from early years would help to reduce the gender gap that has largely been observed in technology and engineering programs in higher education. In this study we wanted to explore students’ beliefs and performance in programming in relation to gender and previous experience. This paper reports on data obtained from first year high school students whose teachers actively attempted to incorporate programming into their mathematics lessons over the course of a school semester during the first year after the reform. We address three questions: a) Is there a difference in in attitudes or beliefs toward programming between students that had programming experience and those who had not? b) Is there a difference in attitudes or beliefs toward programming between male and female students? and c) Is there a difference in code understanding between male and female students? The third question is further analyzed to test the confidence gap hypothesis, which holds that women feel less confident than men in their own abilities. Five student groups from schools across Sweden were selected for the survey among those whose teachers were actively using programming in mathematics. A cross-sectional study was designed addressing the research questions based on data gathered from a group administered questionnaire (N=138). In order to assess students’ understanding of code, three programming exercises in increasing level of difficulty, concluded the survey. Alongside each programming exercise, the respondent had the possibility to express how confident he or she felt about the given answer. For the purposes of data comparison, the chi-squared test of independence was used. The analysis of the data indicates that there are relevant gender differences in students’ views and attitudes towards programming but not in their actual performance when answering code questions. In this case, differences could be attributed to previous programming experience which also seems to influence students’ anxiety toward the reform. However, previous programming instruction did not seem to influence pupil’s beliefs about how useful they thought programming will be in their upcoming education or professional life. Female students were on average less positive regarding how useful they think programming might be for them in the future. We could also confirm the tendency for women to underestimate their programming achievements. Most relevant, female students were more likely to state that they were unsure when the answer was right, whereas male students often felt sure about their wrong answers.