Thursday, November 25, 2010

In which we spend the majority of our time talking

The day started off with Mujtaba informing the class that we had the choice of taking Latin instead of French to get our Language credit next year. I knew this already, because we are in the same French class, and our teacher, Mr. Vetranos, was the one who told us about it. Personally, I'd love to take both. I've been wanting to learn Latin since Grade 3, but I don't want to stop taking French - after all, I've already spent five years in the Extended French program, so why drop it now?

Mr. Arkin told us about how valuable it was to know multiple languages. Being bilingual, trilingual, etc. is very helpful in many different aspects of life, especially getting a job. By the time we finished discussing this, half an hour had already passed. (Yeah...being worried about how much time we would have to actually work on our Repetition Assignments, I kept glancing at the clock. I would've looked at my watch, except it broke. Two months ago. *cry*)

So, after we closed the "forum" on languages, Mr. Arkin provided us with three points that will help one become a better programmer.
  1. Read with precision.
  2. Break a solution into an ordered set of steps.
  3. Visualize contents of memory.
He suggested we read our code to another person, while explaining what each symbol or keyword does (for the first point). Zarin-dono and I sort of do this - we're halfway there. Before each one of us prints out the code, we switch places to take a look at the other's code, pointing out anything that is peculiar or incorrect. Then, we print the code out. This is great, because we save both paper and toner.

I do break a solution into an ordered set of steps when I program. I write half of the documentation section (programmer, date, file name, purpose), then before I do anything else, I think about what I will do. When I have a basic outline of the steps needed to reach the solution, I start writing the program. Like Mr. Arkin previously suggested, I start with the input/processing section. Every time I finish typing out a major action, I make the necessary changes or additions to the declaration and/or initialization sections.

I don't visualize contents of memory unless I am desk checking my code. However, after I do a test run (of my program), I look back at what I inputted and mentally check to see if the processing is done correctly.

---

Then, Mr. Arkin gave a brief demonstration of three ways Repetition Assignment 8 could've been done (for a certain part of the code).

Method 1
if integer > 0 and integer mod 2 = 0 then

Method 2
if integer > 0 then
  if integer mod 2 = 0 then
  ...
  end if
end if

Method 3 (using a boolean expression)
positive := integer > 0
even := integer mod 2 = 0

if positive and even then

The last one is cool, but it requires more variables. If I was writing the program, I would most likely use Method 1 because it is the simplest and most straightforward (in my opinion) out of the three.

---

When we got to go to our computers, we had fifteen minutes left. I barely did anything, because I needed to check over some other stuff.

All our programming assignments are due on Monday. I finished everything, but I'm not sure if I have all the codes printed out. Derr. I need to make a checklist (though  I'd probably lose it anyways).

On another note, tomorrow is the Girls for Girls sleepover. I won't be home until Saturday afternoon (I'm going straight to the library, then dance class after I leave the school.)  I'll do my best to write my blog entry tomorrow afternoon, but if it's not up, you know why. I promise to write it the minute I get to the library on Saturday, though. *smile* I'll make a mad dash for one of the computers!

I think this is the longest blog entry I've written so far, ne? I'll stop talking (typing?) now.

Ja ne, minna-sama!

No comments:

Post a Comment