planning and implementation

One of the hardest lessons to learn is that it’s easier to work from a plan than to wing it. Most things that most people do most of the time don’t require a lot of planning or forethought because they’re repetitive tasks that have been done before. For example, I don’t make a plan to drive to my grocery store because I know the route, I know what I’m likely to encounter, etc.

The truth is, the first time, I didn’t know.  And when you’re creating a project, it’s the first time. When I go to a new place for the first time, I use Google to map it, I figure out how long it will take to get there so I can leave at the right time, I maybe even use the street view to see what the landmarks might be.  A planning worksheet is an equivalent for a software project.  It’s a way to break down the problem of how do I get from nothing to a solution in steps.

Depending on the complexity, a planning sheet will have different kinds of information but since Hangman is my current project, I’m going to frame this topic from that perspective.  There is a worksheet that was thoughtfully provided, but what if there hadn’t been?  What kinds of things would need to be on it?

Well, looking at the rubric, Hangman has to be able to do a lot of things. 

So any planning sheet has to account for that. Since this is Snap, there will be sprites and the stage.  Every script will belong to either a sprite or the stage so sprite ownership is something that needs to be part of the planning sheet.  Also, information will need to be stored. That means variables will be there, too.  I’ll need a column for pseudocode and a column for issues or pitfalls or whatever I want to call the potential snags I’ll run into.  This is not what the planning sheet looks like that was handed out.  
This is a matrix with two examples filled in. Kinda like a spreadsheet.  The first column is the rubric item and the rest are the columns I identified that I, as the project coder, would need to cut the project down to size.  Other people might see the project with different frameworks and have different columns.

The important thing is to have a plan.  And a planning sheet gives you a good place to create one. The better you plan, the less actual work you have to do (at least that’s the theory).  And in my experience, I’ve found it true often enough that I make it a habit to plan many facets of my life, not only my programming projects.

repeat after me (kaleidoscope)

No, Pong is not the next Snap project—a kaleidoscope is.  Here is the example of the kind of thing they mean by a kaleidoscope.

Four sprites moving in synchrony.  This example was presented as you see it—in .gif format.  No clues on how to make one like it except some platitudes. “You will need four sprites.” Well no shaving cream, Sherlock! “The easiest way to create three more is to duplicate the one you have.” You mean there are other ways?  The only way I could figure out to make more sprites without cracking the manual (there is one) is by right-clicking the existing sprite and clicking duplicate.  That also duplicates the code.  So I did break down and look at the manual.

It turns out that green flag is at the top of the stage.  Quick peeky-see at the names of all the areas on the Snap screen—from the actual homework that I actually did that had the actual kaleidoscope program assigned. Here’s that picture.

See the flag?  When you click that, it counts for all the sprites that have that block of code so you can start …. say, four sprites, and have them do synchronous stuff. This is what I came up with.  It is similar, but different, you can look at the code by exiting full-screen mode.  I think that it’s more of the sort of thing I think of as kaleidoscopic.  I think the color should be the same for all sprites but change over time.

Now, I’m ready for Pong.  Well, no, that’s not right, now the next major project i turn in is Pong.  I’ll probably do some other things in the meanwhile.  Pong has a rubric. For those who don’t know, a rubric is a scoring chart that lists aspects of my program and how many points each is worth.  Everything from “Players can control paddles with required keys” to “Program is well-documented and exhibits good style.” Whoa, documented? I don’t think I saw comment blocks in Snap (not that I was looking, mind you).  I’m usually adequate at commenting. I hope that’s good enough for my grader. I guess I’ll find out.

Wish me luck!