If you asked me which concept in the AP CompSci course that I have really understood so far, it would hands down be loops. For loops, While loops, and Nested loops. Somehow they come easy to me. Compared to other subjects of the course which were really hard for me to 'grasp', I understood loops almost right way. I don't really know how this happened, but it did.
In some ways it just seems purely mathematical. So algebraic. I find loops much easier than writing methods or constructing objects. It's almost like I've done it before but at the same time it's all new. The coding in this course started to became simpler when we began if statements. Allow me to explain how I understand if statements and loops.
Something algebraic, like (y = 2x) is much of like an if statement: if y = n, x = 2n. When I took algebra in seventyh grade, I loved the new concept of a variable, and when something so simple is applied in this course, I am once again interested.
And aren't loops just expanded if statements?
for(int n=1, n<4, n++)
{
out.print(n);
}
n equals 1. If n is less than 4, print it. After printing, add 1 to n. If n is still less than 4, print it...and so on.
This is the process I compute when I see a loop. It's so simple and rational. Throughout my life I have always been a "math" person. Math is my thing. How I see it, there is a "math" part of java, which is understanding the processes of codes within the programs. For example, knowing how a nested loop runs.
There is also a "vocabulary" part of java. Knowing which codes are appropriate for building a program. Codes are like words. In order to work with java, you need to know these "words" and their "definitions", or what they do and how they do them. (One must also spell these words correctly or they won't work!) Here's the important part: A good vocabulary means nothing if you don't have the grammar skills to communicate.
Example: James learned a new word today: "a·mel·io·rate" - to make or become better. He wants to impress his teacher by using this big word. His teacher asks him about his day. James replies. "I had a very ameliorate breakfast today." His teacher gives him a puzzled look.
The problem is that James may understand the word, but he doesn't know how to use it correctly in a sentence. A similar story can happen in java. James may know the codes, or "vocabulary", and understand them, but doesn't know how to use them correctly in context. I like to call it "Java grammar".
So what does this all have to do with loops? After learning loops, there was a turning point for me in the AP CompSci course. Because the concept came so easily to me, I was able to have a better understanding of the vocabulary and grammar that was surrounding this little math. Forgive me for making one more comparison, but it's like learning a mathematical equation and later learning how it is applicable in the real world.
Before loops I wasn't very confident in the material that I was learning. Sure, I could type the codes and run the program, but I wasn't really grasping the bigger picture.
No comments:
Post a Comment