Today’s blog post is a short, fun feature from our lead instructor David Gray, enjoy:
In class we often try to connect coding to the real world. The pseudo-code below illustrates one way to look at curve based learning and how challenging it is to learn to code. It supposes that failure is not an option or otherwise that if you keep trying you are going to get it eventually. Effort is the key, you just keep trying. The example below illustrates “perseverance” as a simple for loop. You can ask for help or try on your own but you just have to keep at it, if you want to get it eventually.
Here’s a thought…
One measure of a good programmer is how they budget their time.
At this point you are faced with the following problem:
1. How long do I struggle on this before I ask for help?
2. I asked for help and I still don’t get this. Now what do I do?
Options
A: Work on it some more.
B: Ask for help again.
This is always an issue for a programmer. How long you try before you ask for help and how long it takes you to get something is always a consideration. But if you assume that it’s a given you’ll get it, then you are actually presented with a simple problem…
How many TimesIHaveToTryToGetThis?
Consider this.
PSEUDOCODE
//Do this once when the program starts
function Start(){var whatToTry = 0;}
//do i get this?
var IGetThis = false;
//my options
var helpArray = [”Ask for help”,”Keep on it myself.”];
//number of times I have to try to get finally this
var TimesIHaveToTryToGetThis = “?”;
//number of times I tried
var tryCount = 0;
//trying is just a for loop…
for (var i = 0; i < TimesIHaveToTryToGetThis; i++ ){
//try
var tried = helpArray[ whatToTry];
if(whatToTry == 0){whatToTry == 1}else{whatToTry == 0}
var tryCount++;
if(tryCount == TimesIHaveToTryToGetThis;)
IGetThis =true;
}else{
IGetThis = false;
}
Moral: Just keep at it, ask for help, work on it yourself, in the end you’ll have to learn what balance of those two works best for you so just try both and more importantly keep looping the problem!
D