Eiffel programming language

Eiffel is an object-oriented programming language which emphasizes the production of robust software. Its syntax is keyword-oriented in the ALGOL and Pascal tradition. Eiffel is strongly statically typed, with automatic memory management (typically implemented by garbage collection).

Created in 1985, Eiffel is a mature object-oriented language with development systems available from multiple suppliers. Despite this maturity and a generally excellent reputation among those who are familiar with the language, 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, so it is possible to create subclasses of the basic classes such as INTEGER.

Eiffel has operator overloading, including the ability to define new operators, but does not have method overloading.

Contents

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, sometimes to the extent of describing Eiffel programming as "bondage and discipline".

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. Eiffel seeks to produce a quality software system over anything else.

Lexical simplicity

Eiffel is not case-sensitive. Both 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 style 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 members of the curly brace family of programming languages, Eiffel does not permit expressions to be used as instructions, nor instructions to be used as expressions. Accordingly, 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 it 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 C, and Eiffel provides a straightforward interface to the C routines, including allowing for straight C calls within Eiffel code. Eiffel tends to be quite closely connected to C; three of the four Eiffel compilers produce C code rather than object code.

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 assertions, 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 types. 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.

Eiffel Studio, an integrated development environment for Eiffel, offers an object-oriented interface for software engineering. However, many programmers disliked it because it was very different from user interfaces for other integrated development environments.

Specifications and standards

The official language specification for Eiffel is Eiffel: The Language, first edition, second printing (ETL2), but that book is reportedly out of print. Bertrand Meyer is working on a new version of the Eiffel language specification, but no completion date is available (as of early 2003). In the interim, ISE has made a significant subset of ETL2 available online.

The specifications for the Eiffel language and its basic libraries are nominally under the control of the Nonprofit International Consortium for Eiffel (NICE). Although NICE has sporadically worked on improving the specifications for the basic library classes, it has done little with the language itself aside from ratifying ETL2 and a few changes which already had appeared in the available development systems. In June 2002 ISE submitted the Eiffel language to the European Computer Manufacturers Association (ECMA) for standardization, a move which effectively deposed NICE as the standards body for the language proper.

Hello World

class HELLO_WORLD create
     make
feature
   make is
      do
         print ("Hello, world!%N")
      end
end

External links and references

  • Eiffel Software (http://www.eiffel.com/) web site of the company that introduced Eiffel, was Interactive Software Engineering (ISE).
  • 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 (http://archive.eiffel.com/nice/language/) subset
  • Eiffel tutorial (100 pages) by Bertrand Meyer (HTML (http://archive.eiffel.com/doc/online/eiffel50/intro/language/tutorial-00.html), PDF (http://www.eiffel.com/doc/online/eiffel50/intro/language/tutorial.pdf))
  • SmartEiffel (http://smarteiffel.loria.fr/) fairly complete Eiffel compiler, released under GNU GPL license, was SmallEiffel.
  • NICE (http://www.eiffel-nice.org/) Nonprofit International Consortium for Eiffel.
  • eiffelzone.com Includes a comprehensive Eiffel Software Directory
  • Cetus Eiffel Page (http://www.cetus-links.org/oo_eiffel.html)

Template:Major programming languages smallde:Eiffel (Programmiersprache) eo:Eiffel (programlingvo) es:Lenguaje de programación Eiffel fr:Eiffel (langage) it:Eiffel (linguaggio) ja:Eiffel pl:Eiffel

Navigation

  • Art and Cultures
    • Art (https://academickids.com/encyclopedia/index.php/Art)
    • Architecture (https://academickids.com/encyclopedia/index.php/Architecture)
    • Cultures (https://www.academickids.com/encyclopedia/index.php/Cultures)
    • Music (https://www.academickids.com/encyclopedia/index.php/Music)
    • Musical Instruments (http://academickids.com/encyclopedia/index.php/List_of_musical_instruments)
  • Biographies (http://www.academickids.com/encyclopedia/index.php/Biographies)
  • Clipart (http://www.academickids.com/encyclopedia/index.php/Clipart)
  • Geography (http://www.academickids.com/encyclopedia/index.php/Geography)
    • Countries of the World (http://www.academickids.com/encyclopedia/index.php/Countries)
    • Maps (http://www.academickids.com/encyclopedia/index.php/Maps)
    • Flags (http://www.academickids.com/encyclopedia/index.php/Flags)
    • Continents (http://www.academickids.com/encyclopedia/index.php/Continents)
  • History (http://www.academickids.com/encyclopedia/index.php/History)
    • Ancient Civilizations (http://www.academickids.com/encyclopedia/index.php/Ancient_Civilizations)
    • Industrial Revolution (http://www.academickids.com/encyclopedia/index.php/Industrial_Revolution)
    • Middle Ages (http://www.academickids.com/encyclopedia/index.php/Middle_Ages)
    • Prehistory (http://www.academickids.com/encyclopedia/index.php/Prehistory)
    • Renaissance (http://www.academickids.com/encyclopedia/index.php/Renaissance)
    • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
    • United States (http://www.academickids.com/encyclopedia/index.php/United_States)
    • Wars (http://www.academickids.com/encyclopedia/index.php/Wars)
    • World History (http://www.academickids.com/encyclopedia/index.php/History_of_the_world)
  • Human Body (http://www.academickids.com/encyclopedia/index.php/Human_Body)
  • Mathematics (http://www.academickids.com/encyclopedia/index.php/Mathematics)
  • Reference (http://www.academickids.com/encyclopedia/index.php/Reference)
  • Science (http://www.academickids.com/encyclopedia/index.php/Science)
    • Animals (http://www.academickids.com/encyclopedia/index.php/Animals)
    • Aviation (http://www.academickids.com/encyclopedia/index.php/Aviation)
    • Dinosaurs (http://www.academickids.com/encyclopedia/index.php/Dinosaurs)
    • Earth (http://www.academickids.com/encyclopedia/index.php/Earth)
    • Inventions (http://www.academickids.com/encyclopedia/index.php/Inventions)
    • Physical Science (http://www.academickids.com/encyclopedia/index.php/Physical_Science)
    • Plants (http://www.academickids.com/encyclopedia/index.php/Plants)
    • Scientists (http://www.academickids.com/encyclopedia/index.php/Scientists)
  • Social Studies (http://www.academickids.com/encyclopedia/index.php/Social_Studies)
    • Anthropology (http://www.academickids.com/encyclopedia/index.php/Anthropology)
    • Economics (http://www.academickids.com/encyclopedia/index.php/Economics)
    • Government (http://www.academickids.com/encyclopedia/index.php/Government)
    • Religion (http://www.academickids.com/encyclopedia/index.php/Religion)
    • Holidays (http://www.academickids.com/encyclopedia/index.php/Holidays)
  • Space and Astronomy
    • Solar System (http://www.academickids.com/encyclopedia/index.php/Solar_System)
    • Planets (http://www.academickids.com/encyclopedia/index.php/Planets)
  • Sports (http://www.academickids.com/encyclopedia/index.php/Sports)
  • Timelines (http://www.academickids.com/encyclopedia/index.php/Timelines)
  • Weather (http://www.academickids.com/encyclopedia/index.php/Weather)
  • US States (http://www.academickids.com/encyclopedia/index.php/US_States)

Information

  • Home Page (http://academickids.com/encyclopedia/index.php)
  • Contact Us (http://www.academickids.com/encyclopedia/index.php/Contactus)

  • Clip Art (http://classroomclipart.com)
Toolbox
Personal tools