There are definitely 3 different kinds of students in a computer science class. The experts, the intermediates, and the people who are completely new to computer science. In order for this class to function efficiently I believe it would be necessary to group these different kinds of students and let them know what their expectations are. If they seem to lack the effort to meet those expectations, their grade should suffer for it. However, if a student is clearly putting in the effort and trying, to the best of their ability, to keep up with the all of the work that has been assigned, their grade might not have to penalized as severely. You should inform the student that they are falling behind and try to come up with a solution to the problem. It could be time after school, redoing other exercises, or whatever the educator believes is necessary for the student to catch up. If there is more than one student falling behind, it is possible for class time to be allocated, to a group of students who need it, to allow them to reteach themselves certain concepts they seem to have trouble with. Students who are ahead of the majority of the class should have a higher level of expectations. The teacher should be able to talk to them differently because of their deeper understanding of computer science. They should carry on with their work normally and, if they are interested, possibly be assigned more challenging problems for extra credit or simply to get an even further understanding of programming.