Teachers generally focus on explaining the rules and formats of programming, and students should practice after class in actual operation. Some codes in the book are meaningless to input into the computer in class, but they are usually demonstrated directly. Moreover, it's not easy to do things right or wrong and have problems.
Also, programming mainly depends on students' own practice. Teachers talk about the framework and knowledge points in class, and students may get more marks to help students.