Eiffel Programming Language Article Index for
Eiffel
Website Links For
Eiffel
 

Information About

Eiffel Programming Language




Begun in 1985, Eiffel is a mature language with development systems available from multiple suppliers. Despite this maturity and a generally excellent reputation among those who are familiar with it, Eiffel has failed to gain as large a following as some other object-oriented languages. The reasons for this lack of interest are unclear, and are a topic of frequent discussion within the Eiffel community.

Distinguishing characteristics of Eiffel include Design By Contract (DbC), liberal use of Inheritance including multiple inheritance, a type system handling both value and reference semantics, and generic classes. Eiffel has a unified type system—all types in Eiffel are classes.

Eiffel has the ability to define new operators, but does not have Operator Overloading or Method Overloading .


Elegance, simplicity, or restrictiveness?

The Eiffel language aims to promote clear and elegant programming. Eiffel emphasizes declarative statements over procedural code, and eliminates the need for bookkeeping instructions.

Eiffel intentionally limits stylistic expression, providing few means for clever coding tricks or coding techniques intended as Optimization hints to the compiler. Some software developers feel constrained by Eiffel's simplicity and compiler-enforced structure; the language has been referred to as a "bondage and discipline" language.

In contrast, others feel that the simplicity of the language not only makes the code more readable, but also allows a programmer to concentrate on the important aspects of a program without getting bogged down in implementation details. Eiffel's simplicity is intended to promote simple, readable, usable, reusable, reliable and correct answers to computing problems.


Lexical simplicity

Eiffel is not case-sensitive. Keywords and identifiers can be written in any combination of upper and lower case. The tokens ''MaKe'', ''make'', and ''MAKE'' all refer to the same identifier. Coding standards, however, generally prescribe the use of all-capitals for class names, all-lower-case for variables and method names, and initial capitals for constants, with underscores separating words.

Eiffel's syntax can be parsed without requiring end-of-instruction markers. The use of semicolons as instruction terminators or as instruction separators is left to the discretion of the programmer. Putting a semicolon in or leaving one out makes no difference, except in the unusual case of an instruction starting with a left parenthesis. Most Eiffel programmers choose to omit semicolons except when putting multiple statements on a line.

Eiffel requires that sections and clauses appear in a specific order.

In contrast to most Curly Bracket Programming Language s, Eiffel does not let expressions be used as instructions, nor instructions be used as expressions. Thus, a routine which returns a value can only be used in expressions, while a routine which does not return a value can only be invoked as an instruction.

This philosophy—that expressions and statements are fundamentally different in nature—is expanded into the concept of Command-Query Separation (CQS). Under CQS, a query routine (a function which returns a value) must not change the state of the object, while a command routine will change the state of the object but will not return a value. CQS is strongly recommended for Eiffel programming, but is not actually enforced by the Eiffel system.

Unlike most programming languages, Eiffel is not normally displayed in a monospaced typeface. The recommended display style is to use a proportional typeface. Keywords are shown in bold, user-defined identifiers and constants are shown in italics. Standard upright (roman) style is used for comments, operators, and punctuation marks.


Syntactic simplicity

Eiffel has only six basic executable instructions:
  • assignment

  • object creation

  • routine call

  • conditional

  • iteration

  • choice (case)


Unlike many object-oriented languages, but similar to Smalltalk , Eiffel does not permit storing into fields of other objects. The assignment instruction can only change the value of a field of the current object, or a Local Variable of the current routine. All changes to other objects must be accomplished by calls to methods of that object. Direct access to fields of other objects is "read only" in Eiffel.

The iteration (loop) instruction in Eiffel does not provide a field or clause which will step the loop. The programmer must express the stepping as part of the loop. For example:

from i := 0 '''until''' i >= 10 '''loop'''
my_array.put (0, i)
''i'' := ''i'' + ''1''
end

The example above also illustrates that Eiffel treats arrays simply as instances of the class ''ARRAY'', providing access in the form of routine calls, in line with object-oriented ideas. Eiffel compilers optimize this access.

Eiffel's procedural coding is strictly structured. There are no instructions for exiting a loop or routine early.


NON-OBJECT-ORIENTED OPERATIONS

Eiffel is a purely object-oriented language. Any coding which must be "close to the machine" is expected to be done in s output no Object or Machine code, but only C Source Code as an Intermediate Language , to submit to a C compiler, for Optimizing and Portability .


BACKGROUND OF EIFFEL

Eiffel was originally developed by Bertrand Meyer and his company Interactive Software Engineering (ISE), since renamed Eiffel Software, Inc. Eiffel closely follows Dr. Meyer's work in ''Object Oriented Software Construction, Second Edition''. Eiffel differs from most popular languages in several ways.

The goal of the language, libraries, and programing methods is to create reliable, reusable software modules. It supports Multiple Inheritance , Genericity , Polymorphism , Encapsulation , and Parameter Covariance . Its most important contribution to Software Engineering is Design By Contract (DbC), in which Assert ions, Preconditions , Postconditions , and Class Invariants are used to assist in assuring program correctness without sacrificing efficiency.

Eiffel also offers multiple class inheritance. Many people (such as the designers of Java ) have objections to multiple inheritance. The Eiffel implementation of multiple inheritance, in the opinion of its supporters, successfully meets these objections.

Eiffel's design is closely based on Object-Oriented Programming (OOP) theory, with less influence from other paradigms or support for legacy code. The language has formal support for Abstract Data Type s. In accordance with Self Documentation, a software text should be able to reproduce its design documentation from the text itself. Eiffel accomplishes this by using a formalized implementation of the Abstract Data Type.

, a plugin for Microsoft Visual Studio which allows users to edit, compile, and debug Eiffel apps from within the Microsoft Visual Studio IDE. EiffelStudio and EiffelEnvision are only free for non-commercial use, though.


SPECIFICATIONS AND STANDARDS

On the (ISO) standard.

This standard is not accepted by the SmartEiffel team, which has decided to create its own version of the language, because they think the ECMA standard throws away important principles of the original language. Eiffel Software and Gobo have committed to implementing the standard. Object Tools has not to date expressed a position.

The standard cites the following as earlier Eiffel Language specifications:
  • Bertrand Meyer: Eiffel: The Language, Prentice Hall, second printing, 1992 (first printing: 1991)

  • Bertrand Meyer: Standard Eiffel (revision of preceding entry), ongoing, 1997-present, at Bertrand Meyer's ETL3 page , and

  • Bertrand Meyer: Object-Oriented Software Construction, Prentice Hall: first edition, 1988; second edition, 1997.


The ETL3 page requires a password for access which can be found at Bertrand Meyer's Home Page under Work in progress


DIFFERENCES BETWEEN SMARTEIFFEL AND OTHER IMPLEMENTATIONS

  • EiffelBase , a part of the ISE Eiffel library which has been released under an ISE open-source license, does not compile properly on SmartEiffel . The Gobo library documentation explains that despite heroic efforts, EiffelBase was impossible to port to SmartEiffel.



A "HELLO WORLD" PROGRAM IN EIFFEL

class ''HELLO_WORLD''
'''create'''
   ''make''

feature

''make'' is

do

''io.put_string'' ("''Hello, world!%N''")

end

end


SEE ALSO



EXTERNAL LINKS



REFERENCES

  • ''Object Oriented Software Construction, Second Edition'', by Bertrand Meyer , Prentice Hall, 1997, ISBN 0-13-629155-4; contains a very detailed treatment of the beliefs about object-orientation behind Eiffel.

  • Eiffel: the Language subset