In computer programming, what is the general term for a named, self-contained block of code that performs a specific task and typically returns a value?
Show answer
Function
Functions are the fundamental building blocks of modular programming, allowing developers to reuse code efficiently rather than rewriting it multiple times. You can think of a function like a kitchen appliance; for example, a blender takes ingredients as input, performs a specific task, and returns a smoothie as the result.
Also asked as:
- In programming, what term describes a self-contained, named block of code designed to perform a task and return a value?