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