Arguments in programming can be thought of as ingredients in a recipe. Just like a recipe specifies certain ingredients that are needed in order to prepare a dish, a function in a program specifies certain arguments that are needed in order to perform a task. Just like different recipes require different ingredients, different functions require different arguments. Just like ingredients are used in specific amounts and in a specific order when following a recipe, arguments are used in specific positions and in a specific order when calling a function. Just like ingredients can be substituted or left out entirely when following a recipe, arguments can be omitted or given default values when calling a function. Just like ingredients can be combined and transformed to create a finished dish, arguments can be used and processed by a function to produce a certain output.
top of page
bottom of page
Comments