We study which observable affective states and behaviors relate to students' achievement within a CS1 programming course. To this end, we use a combination of human observation, midterm test scores, and logs of student interactions with the compiler within an Integrated Development Environment (IDE). We find that confusion, boredom and engagement in IDE-related on-task conversation are associated with lower achievement. We find that a student's midterm score can be tractably predicted with simple measures such as the student's average number of errors, number of pairs of compilations in error, number pairs of compilations with the same error, pairs of compilations with the same edit location and pairs of compilations with the same error location. This creates the potential to respond to evidence that a student is at-risk for poor performance before they have even completed a programming assignment.