Option-operand separation
Encyclopedia
Option-operand separation is a principle of imperative
computer programming
. It was devised by Bertrand Meyer
as part of his pioneering work on the Eiffel programming language
.
It states that an operation's arguments should contain only operands — understood as information necessary to its operation — and not options — understood as auxiliary information. Options are supposed to
be set in separate operations.
The motivations for this are:
Imperative programming
In computer science, imperative programming is a programming paradigm that describes computation in terms of statements that change a program state...
computer programming
Computer programming
Computer programming is the process of designing, writing, testing, debugging, and maintaining the source code of computer programs. This source code is written in one or more programming languages. The purpose of programming is to create a program that performs specific operations or exhibits a...
. It was devised by Bertrand Meyer
Bertrand Meyer
Bertrand Meyer is an academic, author, and consultant in the field of computer languages. He created the Eiffel programming language.-Education and academic career:...
as part of his pioneering work on the Eiffel programming language
Eiffel (programming language)
Eiffel is an ISO-standardized, object-oriented programming language designed by Bertrand Meyer and Eiffel Software. The design of the language is closely connected with the Eiffel programming method...
.
It states that an operation's arguments should contain only operands — understood as information necessary to its operation — and not options — understood as auxiliary information. Options are supposed to
be set in separate operations.
The motivations for this are:
- Ease of learning: Beginners do not have to concern themselves with setting options.
- Wide spectrum coverage: Experts can still set options using the auxiliary operations.
- Evolution. Options are more likely to change than operands, so the parameter list to the operation remains more stable.