分类:
2009-04-08 15:24:42
When you're planning a party, do you ? Does it make sense to pick up the food from the caterer before you've booked a the rec hall? Once you've booked that rec hall, though, how do you remember the address to give to the caterer? In its simplified form, a computer program can be thought of as a structured "To-Do" list. Each thing on the list needs to be completed to accomplish a final task, but also needs to done in a certain order.
If your computer program is your party list, than variables are the sticky notes you use to keep track of all the data you've collected. Without your sticky notes, you'd be at a loss as to how to move forward with planning. Without , your Ruby program isn't able to keep track of its data either.
Computer programs often have to perform actions more than just once. For example, if your program prints all new information added to your pot luck list, it will need to print more than just a single time. This can be accomplished using a construct known as a .
chinaunix网友2011-08-11 03:19:15
Thanks. Indeed these are important features. Some examples on the same blog would be helpful too. Some nice examples can be found here on ruby hash.