API
-
When I taught CS (20+ yrs ago :)), I likened an API to a "name for a series of actions", for example
turnOnTheStove()
. In the world of cooking, thedice
API takes a parameter (eg:potato
) and returns something (diced potatotes
). Obviously you can't dice an oak tree, so the "type" of the parameter is important (eg:Vegetable
). As you get deeper, you could genericize the type to an interface (eg:IDiceable
), which would include vegetables and certain meats. A library of APIs is nothing but a cookbook. Just as you reference a cookbook on Indian cooking to follow a recipe for Chicken Vindaloo, you could use a specific library (eg:gdi32.dll
) to perform graphics related actions. I find there's a strong correlation between a creative activity like cooking and software engineering. It helps to find analogies in the culinary space as they are readily understood by most people. /ravi My new year's resolution: 2048 x 1536 Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)comInteresting. I find in teaching that many people say that they can't do algebra. I use the recipe analogy to illustrate using equations with great success. For example, A Yorkshire Pudding takes 1 cup of flour, one cup of milk, 1 tsp of salt, and two eggs to make 6 servings. How many eggs do I need to make 12 servings? Nearly everyone can figure that out, then I represent it in equation form and show them that they've been doing algebra all along, just didn't know what to call it. A good analogy is worth a dozen teachers.:-D "...a photo album is like Life, but flat and stuck to pages." - Shog9