Upload
geraldine-oliver
View
218
Download
0
Embed Size (px)
Citation preview
Effective C#50 Specific Way to Improve Your C#
Item 50
Effective C#50 Specific Way to Improve Your C#
Item 50
Scott68.Chang
AgendaAgenda
• Item 50: Learn About the ECMA Standard
Item 50: Learn About the ECMA Standard
European Computer Manufacturers Association (ECMA)European Computer Manufacturers Association (ECMA)• The ECMA standard is the official word on how
every feature in the C# language behaves. – ECMA-334 defines the 1.0 standard for the C# language.– ECMA-335 defines the Common Language Runtime (CLR)
and Common Language Infrastructure (CLI) standards.
Goals of C#Goals of C#
• C# is intended to be a simple, modern, general-purpose, object-oriented programming language.
• The language should provide:– strong type checking, array bounds checking, detection of
attempts to use uninitialized variables, and automatic garbage collection
– Software robustness, durability, and programmer productivity are important.
• The language is intended for use in developing software components suitable for deployment in distributed environments.
Goals of C# (cont.)Goals of C# (cont.)
• Source code portability is very important– especially for those programmers already familiar with C
and C++.• Support for internationalization is very important.• C# is intended to be suitable for
– writing applications for both hosted and embedded systems,
– ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions.
Goals of C# (cont.)Goals of C# (cont.)
• C# applications are intended to be economical with regard to memory and processing power requirements– the language was not intended to compete directly on
performance and size with C or assembly language.
ECMA 334ECMA 334
• The representation of C# programs;• The syntax and constraints of the C# language;• The semantic rules for interpreting C# programs;• The restrictions and limits imposed by a
conforming implementation of C#.• The mechanism by which C# programs are
transformed for use by a data-processing system;• The mechanism by which C# applications are
invoked for use by a data-processing system;
ECMA 334 (cont.)ECMA 334 (cont.)
• The mechanism by which input data are transformed for use by a C# application;
• The mechanism by which output data are transformed after being produced by a C# application;
• The size or complexity of a program and its data that will exceed the capacity of any specific data processing system or the capacity of a particular processor;
• All minimal requirements of a data-processing system that is capable of supporting a conforming implementation.
Common Language Infrastructure (CLI)Common Language Infrastructure (CLI)
• Written in multiple high-level languages can be executed in different system environments without the need to rewrite those applications to take into consideration the unique characteristics of those environments.
ECMA 335ECMA 335
• Concepts and Architecture – Overall architecture of the CLI– Common Type System (CTS)– Virtual Execution System (VES)– Common Language Specification (CLS)
• Metadata Definition and Semantics– physical layout (as a file format)– logical contents (as a set of tables and their relationships)– semantics (as seen from a hypothetical assembler, ilasm)
• CIL Instruction Set– Describes the Common Intermediate Language (CIL)
instruction set.
ECMA 335 (cont.)ECMA 335 (cont.)
• Profiles and Libraries– Overview of the CLI Libraries, – A companion file, CLILibrary.xml, provides details of each
class, value type, and interface in the CLI Libraries.• Debug Interchange Format
– Describes a standard way to interchange debugging information between CLI producers and consumers.
• Annexes– Sample programs written in CIL Assembly Language
(ILAsm)– machine-readable description of the CIL instruction set – a set of guidelines used in the design of the libraries and
portability considerations.
SummarySummary
• ECMA 334 可參考– The C# Programming Language, by Anders Hejlsberg, Scott
Wiltamuth, and Peter Golde (Addison-Wesley, 2003). • ECMA 335 可參考
– The Common Language Infrastructure Annotated Standard, by James Miller and Susann Ragsdale (Addison-Wesley, 2003).