Read the article this discussion is about
»
Guy Lecky-Thompson
- Functions
Hello,
At the risk of blowing my own trumpet, you might like to try http://computerprogramming.suite101.com/... which discusses all manner of functions.
A quick definition might be that a function is a block of code that can be called by name. So, if you have a robot that could do all manner of different household tasks, one function might be 'WipeTable' as part of the 'CleanKitchen' program.
Now, the 'WipeTable' function could also apply to other tables that the one in the kitchen, so we might make the function capable of taking a parameter. Then we could say 'WipeTable(KitchenTable)' as part of the 'CleanKitchen' program, and 'WipeTable(LoungeTable)' as part of the 'CleanLounge' program.
Taking this a step further, there could be a 'Wipe' function, called from the 'WipeTable' function. This might be used in conjunction with other objects - 'Wipe(Table)', 'Wipe(Window)', or even 'Wipe(Floor)'.
That's the power of functions.
Best,
Guy
Please follow the guidelines set forth in the Suite101 Posting Etiquette when adding to the discussion.