As it's time for my morning coffee (the coffee not the biscuits), it's as good a time as any to share my one of my favourite #programming analogies
_(narrated from a #Python-viewpoint but general enough for #coding in general)_
**The Coffee Machine - Function analogy**
Let's make some coffee…
_[read on]_
/1
— 3 —
When you call the function/press the "On" button on the coffee machine, the machine will "do stuff" inside.
If you just care about drinking your coffee, you don't care what's happening inside the machine…
If you're an engineer building your own coffee machine, or you want to open up your coffee machine to fix it or—ahem—make improvements, then you _do_ care about what's happening inside the coffee machine.
4/
Instead, you should put a coffee cup in the machine when you turn it on:
`>>> cup = make_coffee(`
`... electricity,`
`... water,`
`... my_favourite_blend,`
`... )`
Now, you no longer make a mess on the kitchen bench you're collecting what's returned into something
There's a fuller version of this analogy here, too:
https://thepythoncodingbook.com/2022/09/14/functions-in-python-are-like-coffee-machines/
8/