Jump to content

Option–operand separation

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Sasuke Sarutobi (talk | contribs) at 11:59, 28 February 2020 (Changed stub type to more specific "programming language theory" stub). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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:

  1. Ease of learning: Beginners do not have to concern themselves with setting options.
  2. Wide spectrum coverage: Experts can still set options using the auxiliary operations.
  3. Evolution. Options are more likely to change than operands, so the parameter list to the operation remains more stable.