Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. API

API

Scheduled Pinned Locked Moved The Lounge
jsontutoriallearning
21 Posts 15 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Ravi Bhavnani

    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, the dice 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)com

    R Offline
    R Offline
    Roger Wright
    wrote on last edited by
    #21

    Interesting. 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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups