Conceptual
Login

Writing Focused Functions in Python

This concept covers function design principles in software engineering, centered on the Single Responsibility Principle applied at the function level: a function should perform one task at a single, consistent level of abstraction. Related theoretical constructs include Command-Query Separation (Bertrand Meyer's principle that a function should either perform an action or return information, not both), dependency injection (supplying collaborators as parameters rather than constructing them internally to reduce coupling), and the treatment of functions as first-class objects in a language, enabling higher-order composition such as passing functions as arguments, returning functions, and partial application. The domain is software design/code quality within programming language theory, specifically the sub-discipline of function-level design and code smells, which relates to the broader discipline of software maintainability and object-oriented/functional design principles.