Eiffel 程式設計
外觀
(從 Eiffel 程式設計 重定向)
歡迎來到華夏公益教科書上的“Eiffel for Everyone”。
Eiffel 最初由 Bertrand Meyer 開發,它擁有簡潔且易讀的語法。該語言的許多設計原則都強調程式碼的可讀性和可維護性。
由於其對語言特性(如 多重繼承 和 泛型(尤其是受約束的泛型))的出色實現,使用 Eiffel 表達複雜思想所需的程式碼量比其他程式語言要少。強大的型別系統以及全面的靜態型別檢查使程式能夠輕鬆地擴充套件規模,並以其他語言難以實現的方式進行演化。
Eiffel 由於語言過於冗長而受到批評,並且很容易讓人對它的一些結構(如迴圈語句)的冗長性感到厭煩。然而,我發現其他語言(例如 C 家族,包括 Java 和 C++)經常以簡潔著稱,但在複雜型別的宣告和使用方面卻非常冗長。
- 一切皆為物件
- 契約式設計
- 單一入口,單一齣口
- 開閉原則
- 命令/查詢分離
過去、現在和未來的版本
[編輯 | 編輯原始碼]Contracts and contract inheritance Rich set of assertions Multiple Inheritance Constrained Genericity Type-safe agents (also known as closures) Void Safety SCOOP (Simple Concurrent Object Oriented Programming)
Eiffel Names
Reserved words
Notes or indexing
Name
Inherit
create
features
more notes
the end
Features
Attributes
Functions
The Uniform Access Principle
Procedures
Commands vs Queries
Implementing Features
Local Variables
Creating objects
Assignment
Calling features
Operators
Expressions
Copying Objects
Comparing Objects
Conditional control
The if statement
The inspect statement
Iteration—looping
Flow of Control
Attachment Checking and Locals (e.g. if attached l_foo as al_foo then ... end)
Expanded Types
INTEGERs of Various Sizes
REALs
CHARACTERs
BOOLEAN
Reference Types
ANY
STRINGs
DATE
Containers
What's required What's ensured Invariants: What is always true (about a class) Checks Variants and loop contracts
Why its useful
How it works
LSP
Renaming
Redefining
Undefining
Extending
Non-conforming inheritance
Implementation inheritance
Multiple inheritance
Inheritance of Contracts
With Containers With Algorithms Constrained Genericity Example: Hash tables
Uses for tuples Returning multiple values from a function Named tuples
As a way of iterating over containers Using agents Closed and Open Arguments Agent declarations
Covariance and Anchored Types
Memory Management Details
Garbage Collection Limitations
Interfacing to Other Languages
.Net Support
Low-level Debugging