This semester my Programming 3 (and maybe my Programming I) kids are going to play a lot of tic-tac-toe. Back in March Alfred Thompson wrote an article on Tic Tac Toe for Windows Phone. Not having a Windows Phone (Saw my first one a couple of weeks ago. Montana is like wayyy out there in the hinter lands tech wise.) I figured I would borrow this idea and the code and modify it for Corona, the language I use in my Programming classes to write Droid programs. I thought it was fairly straight forward, I got the game working and, using my usual flawed deductive logic, I figured if I could do it, the kids could do it. Opps. They wanted to type code without figuring out the game. Of course they did not want to figure out the game! Everybody knows tic-tac-toe, it is a trivially simple game after all! So after two days of trying to get them to stop sitting at the computer and coding on the fly I went to a different project. It was near the end of the semester and I simply did not have time to do what I should have done in the first place, teach how to define the game and therefore the program by breaking it down into pieces to understand the logic. I need to find a classroom without any computers to distract the kids while I am teaching computer programming.
Tic-tac-toe is far from a trivially simple game to a novice programmer. Look at the first step – draw a 3X3 grid for the game board. On a piece of paper there are not a lot of options, four little line segments placed about here and we are done. On the computer it is necessary to locate the end points of the segments (not to difficult) and draw the segment in some color. But wait. Do we want segments defining the game board or nine boxes? And if we use boxes how do we get the X and O to appear? No wait. How about three different icons, empty, X and O and we can use those to be the game board and the moves! This cannot be figured out in front of a computer on a keyboard (even if we do it all the time).
I need to teach much more programming away from the computer. It is very difficult to do for several reasons. First and foremost it is really fun for both me and the kids to make visual things happen on the computer. Secondly, all the programming texts and tutorials are coding syntax based. A few are “Chapter 1 – Problem Solving, Chapters 2 – 13 – Syntax”. I need “Chapters 1 – 5 – Problem Solving, Chapters 6 – 13 – Syntax”. I believe the core of a programming course should be problem solving with coding syntax being merely a tool to teach that problem solving. The trouble is it is so much easier to teach coding that the true objective gets lost.
A true programming course should be language independent. I want to be able to give my students a programming problem, give them a couple weeks to diagram and pseudo-code the program, and then pick one of several languages for execution. From there I want them to find a language reference and then learn enough code to convert their diagram to an executable program. It is going to be difficult to not make pretty things happen on the screen for a while.
Teaching high school programming is a balancing act. Games and pretty things on the screen attract students to the elective. Problem solving is hard work for the average kid (and teacher) and therefore scares students away from the elective. Finding a viable middle is not easy.