In programming, what is the term for a collection of code that performs a specific task? 🔊
A collection of code that performs a specific task is known as a function or a method, depending on the programming language and context. Functions are reusable blocks of code that take input, process it, and return output. They help improve code organization, reduce redundancy, and enhance modularity in software development. By encapsulating specific functionalities, functions make complex programs easier to read, troubleshoot, and maintain, promoting better programming practices and efficiency.
Equestions.com Team – Verified by subject-matter experts