M  

 

The Private Site of Fariborz Moradi


 
 

Laura sure has a strange way of saying things, doesn't she? It would be possible to explain what each word in those first two lines does, but it wouldn't make much sense to you at this point, and it would really tax my small brain, so let's skip it for now, eh? What's important to know is that that line is how Laura let's her editor know that this piece of paper is her main routine, or plot.

When she decides to specify those variables (saloons, etc) that were not specified in the WesternTown class, Laura first states the name of the object (in this case, sweatyPost. Remember that sweatyPost is an object of WesternTown) followed by a period and then by the name of the variable. Having done this, Laura can then provide a value for the variable, such as two.

----------------------------------------------------------------------------

So, believe it or not, you've just seen object-oriented programming in action. Our author Laura first created a class (that was the binder) that roughly described a Western Town, then turned to her main plot page and created (instantiated) a western town object, which she then called sweatyPost.

Now, for her villain, Laura needs a different binder. So she puts "Western Towns" back on the shelf, and goes to pick up a new binder. Her hand passes over many different titles, like "Animals", "Weapons", "Weather", "Music", all the essentials for a good Western, until she finally comes to the binder she wants: "Humans".

She opens up to the introduction:

"All humans start out with two legs, two arms, eyes, a nose, and a mouth. They are either male or female, have a name, have a horse with a name, and have different preferences in whiskey. If somone asks, humans can respond with their name."

 


 



 

 
 
 
©2006 Fariborz Moradi       Contact