Eiffel Coding Standard

Language consideration

  • Do not put a blank line between
  • Do not use assertion clauses without tag names.
  • create and creation instructions
  • inherit and parent clauses

A sample of proper formatting of code:note description: "Descr...." date: "$date: $" class A inherit B rename f as g end create make feature {NONE} -- Initialization make (a: INTEGER) -- Initialize Current with `a`. do end invariant a_positive: a > 0 end

Style

  • If instructions:

if expr1 then ... elseif expr2 then ... else ... end

If expressions are very long, break them on conjunctions as in:if expr1 and then expr2 then ... end

  • Loop instructions:

from ... until ... loop ... end

  • Inspect instructions:

inspect expr when val1 then .... else ... end

or

inspect expr when val1 then ... else ... end

  • For punctuation, we always have
    • a space before, and no after (
    • no space before, and space after ) , : or ;

require a_tag: query (a, b, c) or other_query (c, d) local i: INTEGER; j: INTEGER