Home Topic 4 Last Next


Identify pre-planning in a suggested problem and solution.


Teaching Note:

Gantt charts.

Pre-ordering. Pre-heating an oven. Home/locker/knapsack.

Caching/pre-fetching. Building libraries of pre-formed elements for future use.

LINK Thinking procedurally, thinking concurrently. Connecting computational thinking and program design, introduction to programming.


Sample Question:


JSR Notes:

The Importance of Planning

The idea of this one starts with the fact that planning is So, So, So important in programming, and software development. When you don't plan properly, you can end up having to re-work things, and end up losing months of work, or worse still, your final product can be rejected by your client.


Pre-planning vs. Planning

With planning, you can't plan correctly until you first identify the things that need to be planned, i.e. pre-planning. Identifying re-planning is not necessarily a long activity, but it must be a thoughtful one, in which you identify the things that will need to be done through your planning stage. So pre-planning is listing things to plan, versus the actual process of full planning. One of the important things that can done at this point is ordering your planning steps.


Planning a Project vs. Planning a Method

Pre-planning and planning exist at every level of I.T., from the largest corporate project, involving thousands of people, and multi-millions of dollars, to a single small program created by one person.


Pre-planning/actual Planning of a Project

First of all, take a look at the Gantt chart below. Actual charts like this will be an important part of any team getting themselves orgainzed for a large project. The Gantt chart breaks the overall project into several major stages of tasks, and then each of them is broken down further into subtasks. The amount of time needed for each is estimated, along with the start time. You'll note that some tasks can take place at the same time, but others must wait for the completion of prerequisite tasks.

By Alex Thompson and Derrek Harrison Public Domain

Though it will be only you on your own, there is still a large amount of planning which you will be required to do for your IB CS internal assessment. To get an idea of some of these planning tasks, take a look at the IA Guide, Stages ("Criterion") A and B. You will see things like interviewing your client, coming up with criteria for success, sketching out prototypes, designing class structures, and thiking about the data types you will use.


Pre-planning/actual Planning of a Function

Even making a single method of a class should involve planning. In terms of planning terminology, this means thinking about "pre" and "post conditions". You can read more about these in the next two assessment statements, but what this boils down to is requirements of your function to execute properly, and what it will do. So in simple terms input required, and output produced.

64     /*Pre-conditions: a number between 0 and 100 sent.
66       Post-conditions: a single letter (A to F) will be returned as a String.
67     */
69     public static String convertToLetterGrade(double grade){
70         if(grade > 89){
71             return "A";
72         }
73         else if(grade > 79){
74             return "B";
75         }
76         else if(grade > 69){
77             return "C";
78         }
79         else if(grade > 59){
80             return "D";
81         }
82         else{
83             return "F";
84         }
85     }

You'll note that the pre and post conditions above are not just for planning - they are primarily for the prospective users of the method - but they certainly help in planning also. With properly thought out pre and post conditions, you have thought about what parameters will be needed, and what your method will accomplish, including if there is a return value, what it is.


"Life Example"

General pre-planning example: "Saturday Errand Example" - here's an example that you may able to identify with. Friday evening in Prague, I would regularly pre-plan how I was going to get my Saturday errands done; I'd pull out all my yellow stickies of the week, read through them, sort them according to area of Prague (usually: Vinohrady where I lived, close to the school, or at the mall), then I would think about the most efficient route to walk/drive around doing them all, and I write down on a normal piece of paper my plan, in the order in which I would do those things. Other than geographic consideration, the one other consideration sometimes was if there were things that Had to be done, and also possibly things that were optional, in which case I'd plan to do the Must Do ones first.



Focus on the Teaching Notes:

Teaching Note "Gantt charts." This would be an example of a project pre-planning document.

This is from Excel. Companies and organizations use it to plan. Notice that certain tasks can go on at the same time because they don't depend on each other. This could be treated as a first glimpse into the concept of "concurrency": various things can progress at the same time.


Teaching Note "Pre-ordering. Pre-heating an oven. Home/locker/knapsack."

The idea here is that quite often in life, we are able to prepare for the "main event", well in advance. We "lay the groundwork" as the expression goes. And the more you can do this sort of thing, the better an event/activity is bound to go. It's not necessary to pre-heat an oven, for example; you could still eat the pizza afterward, but it won't taste as good. Or you could hold a CEESA sporting event, gathering up and doing things as you go, but it would be better to phone the referees ahead of time, and paint the lines on the field and get the SCA to bring in the goodies for the Sports Boosters canteen.


Teaching Note "Caching/pre-fetching. Building libraries of pre-formed elements for future use."

And so in programming/computer science, there are things that can be done "ahead of time". Caching is the best example. Why bother starting to watch a streamed video if you know you will have to wait for content to download every few seconds. Better is to let a bunch download, i.e. buffer, and when enough is buffered in your computer's cache that it is "ahead of the game" enough, then you start to watch, knowing that your viewing will be uninterrupted, since what is being buffered presently is always a minute or so ahead of what you are watching.

Building libraries of data ahead of time is another thing that since it can be done ahead of time, why not? and that way when it comes time to use those libraries, the data does not have to be collected; it's already there to be used. This also speeds up "the main event".