Additional profile information on Alfred Thompson at Google+
I’ve been experimenting with Construct 2 from Scirra the last few days. Construct 2 is a program from creating HTML 5 games. What really got my interest was that there is the ability to create Windows 8 games using Construct 2 with Visual Studio 12. The Construct 2 development environment is pretty easy to use and I find that some similarities to Visual Studio (among other tools) is helpful in finding ones way around it. The image below shows the layout of graphical objects on the screen as well as the properties box, list of images and outline of the project. Very similar to what I am used to.
The coding involves what is called an event sheet. On an event sheet specific events (for example a mouse click) are specified and one or more actions are described to be the result of that event.
I really like that for a single event you can easily specify different actions for different objects in the game. And of course by the nature of the IDE syntax errors are avoided which is a plus for beginners.
Programs/games are created in the Construct 2 IDE and tested in a web browser. Once a game is completed it can be exported into several formats including the experimental Windows 8 app.
My next step is to outline the things you’ll want to include in a game that you make with Construct 2 in order to make it fit the guidelines for inclusion in the Windows Marketplace. But in the mean time Construct 2 looks like an interesting tool for starting with game development as a way to hook studnets on to software development. Anyone else using it? What do you think of it?
Getting started links:
Did you follow the landing of the latest Mars rover – Curiosity? Well if you did or even if you just know a bunch of space crazy students the latest version of Kodu is for you. Last week Microsoft announced (and launched) Kodu:Mars Edition. Download it at http://www.kodugamelab.com . Some of the new features:
I think the new robot is cute. I had an early preview of Kodu: Mars Edition and I think it has the potential for combine kids fascination with robots and space in a way that encourages them to explore computer science and programming. After all it was great software that make that amazing landing possible.
We don’t teach students how to read code. Actually we don’t event teach them that they should read code for the most part. The closest we get is sample code in textbooks, demos, and for AP CS teachers the case study. Even there I think we could do more. One of the great learning experiences of my early learning career involved reading some code. My professor handed me a deck of cards (yes this was some time ago.) He explained that they had purchased this set of functions to help enable graphics programming but somewhere along the line the documentation had been lost making this code unusable. There were almost no comments in the code either. My task was to figure out the code and create some documentation so that other people could use these routines. With all the enthusiasm and confidence of youth I jumped in with gusto. It took a while but I accomplished the task. In the process I learned a lot about both figuring out code and using graphics functions. Both served me well over the years. I still think about that now and again wondering if that sort of thing could be globally useful in education. Or is it just mean?
I still enjoy reading and figuring out other people’s code. In some ways that, especially when debugging is involved, is more fun for me than writing code from scratch. I’ve never really organized my thoughts about reading code before but I’ve been thinking about it lately and thought I’d put it down so you all could tell me how wrong I am. Or at least tell me what else you do when studying code that is new to you.
I like to read code on paper. Yes old fashioned and kills trees but it lets you look at more code at one time than you can see on a screen. I know that there is some discussion that any code that doesn’t fit on one screen should be broken up into smaller pieces and to some extent I agree. On the other hand some things don’t fit on one screen and more then that often you can benefit from more context than one method on one screen. Also I like to draw lines and write notes and that is easier on paper.
In he early days code was often “ugly” with no indentation or helpful formatting. In fact we used to have special software called “prettyprint” programs that would reformat code by adding indentation, consistent use of white space and “punctuation.” I especially remember using software like this on PASCAL programs when I was teaching high school. The need for this sort of thing is less today than it used to be. IDEs like Visual Studio for example will automatically format code and even include helpful color coding. These things make looking at code, on line or on paper, a lot easier. Reading poorly formatted code is harder than you want it to be so if your code is not well formatted then fixing that is a great first step.
Next I like to look at variables. I like to understand the names, especially any coding standards that are being used, and what they mean. Knowing that a variable is an integer as opposed to a double is important. Making sure that coding conventions (do integer variables start with an “I”) and being followed (is a variable a double but its name suggests an integer) is a good place to look for logic or runtime errors. Keeping an awareness of scope of variables is also important. Comments on variables and throughout the program can of course be very helpful. My attitude about comments is “trust but verify.” That is to say that I try to confirm that the comments describe the code that they say they describe. If they fit – great. If they are wrong – fix them.
I like to draw lines to highlight things like the beginning and end of a loop, a module, or the actions inside a decision structure. The spacing along may be enough for some but I like that line down the side of the page. It helps me visualize the scope and the nesting of statements and variable scope. This also helps me to study the code to make sure the start and end are logical and correct. Once you have all the scopes figured out you can start from the inside and work out or from the outside and work in. In practice, if the code is at all complex, you may have to read it both ways. Take notes of what is going on. It helps.
Equations require a close look. One has to understand both what the formula is supposed to do but that the variable types work the way the programmer intended. There is no magic “do what I mean” instruction. All too often the computer follows its own consistent logic when a programmer was hoping (or miss-assuming) some different way of doing things. It’s also important that the values that are returned are of the type that the method says will be returned. A reason that I find paper useful is to double check parameters between where a method is called and where it is created. Again modern IDEs can make that easier for you. While reading code in the IDE IntelliSense in Visual Studio or other autocompletion tools can make checking a lot easier without bouncing around the file. So a mix of online and offline reading can be very useful. Use the tool that makes the most sense at the time.
The big gun in reading code can be a debugger. Single stepping through running code, assuming you are trying to understand code that works, can teach you a lot about what paths are taken and show you where things are not going where you think they are going. This is a lot easier today with modern IDEs compared to reading binary code in light switches back in the day. Today anyone can run a debugger. And more people should!
So that is the basics. I’m sure I’m missing things that I do without really thinking about it. What advice do you have for someone reading code?