Effective C# 原則50:瞭解ECMA標準(譯)

來源:互聯網
上載者:User

Effective C# 原則50:瞭解ECMA標準
Item 50: Learn About the ECMA Standard

ECMA標準是C#語言所有功能的官方說明。ECMA-334定義了C#語言1.0的標準,你可以從The C# Programming Language這本書上學習C#2.0的計劃(譯註:現在已經不是計划了),這本書的作者是Anders Hejlsberg, Scott Wiltamuth, 和 Peter Golde (Addison-Wesley, 2003)。這本書是一個語言手冊,而不是指南。它詳細說明了這門語言書面定義的每一個功能。每一種語言都只一種標記,可以讓你更加明白每一種語言的功能。當我還在寫這本書的時候,我還經常把這書放在我的桌子上參考。

如果你認真的C#程式員,你應該明白這門語言,包括在不同功能後面的基本原理。如果在你工作的時候,你知道在什麼時候應用每一個功能,它就會讓你的工作更容易。你可以更好的理解隱藏在不同語言運算式後的每一個不同細節。

對於C#的附帶內容,你應該徹底的明白公用運行時(CLR)。CLR以及公用語言基礎(CLI)標準在ECMA-335中有定義,這也是CLR標準。做為C#,這還是1.0的標準。公用語言基礎標記標準這一書(The Common Language Infrastructure Annotated Standard),由ames Miller 和Susann Ragsdale (Addison-Wesley, 2003)所著,解說了CLI的2.0版本。這是一本包括公用語言子系統(CLS)的使用手冊,這會協助理解CLS遵從性(譯註:前幾天才看到MSDN上把compliance翻譯為遵從性,而我一直理解為相容性,當然相容性有其它的詞,很多時候是理解的問題。)的背後原則。這同樣可以協助你明白.Net運行時和基礎的ECMA標準。

C#和CLR委員會還在發布工作文檔,用於討論的發展C#語言的2.0版本以及CLR。這些討論對於明白C#今後會如何發展以及改變是很有價值的。

另處,深刻理解當前的標準以及增加的意圖可以協助你建立經得起時間考慮的代碼。通過理解這些可能添加到語言以及進行環境上的功能,你可以在建立軟體時立於一個有利的位置上,而且可以持續更久。你可以預料到一些可能因某些必然因素而做出的修改。

軟體設計隨時在改變,C#也會發展和改變,很可能過時候就會在2.0上發展幾個版本。這是一個工具,你可以每天都利用它,至少是大多數日子。學習更多的官方說明,而且總是站在這些內容的最項上。

==========================
 
       

Item 50: Learn About the ECMA Standard
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. You can learn about the C# 2.0 proposals from the book The C# Programming Language, by Anders Hejlsberg, Scott Wiltamuth, and Peter Golde (Addison-Wesley, 2003). This book is a language reference, not a tutorial. It explains in very pedantic detail exactly how each feature of the language works. Each language feature is annotated so that you can better understand the justification of each language feature. While I was working on this book, I constantly had this reference open on my desk.

If you are a serious C# programmer, you should understand the language, including the rationale behind different features. It will make your job easier if you know when to apply each feature in your own work. You will have a better understanding of any subtle differences in different language expressions.

In addition to the C# language, you should understand the Common Language Runtime (CLR) thoroughly. The CLR and Common Language Infrastructure (CLI) standards are defined in ECMA-335, the CLR standard. As with C#, this is version 1.0 of the standard. The Common Language Infrastructure Annotated Standard, by James Miller and Susann Ragsdale (Addison-Wesley, 2003), explains the CLI version 2.0. This reference includes the Common Language Subsystem (CLS), which will help you understand the rules behind CLS compliance. This also helps you understand the ECMA standard for the .NET runtime and infrastructure.

Both the C# and CLR committees continue to publish working documents on the discussion and progress of the 2.0 version of the C# language and the CLR. The discussions are a valuable way to understand how C# will grow and change over time.

In addition, a deeper understanding of the current standard and the proposed enhancements will help you create code that stands the test of time. By understanding the features that will be added to the language and the environment, you are in a better position to create software that lasts longer into the future. You can anticipate the future modifications that might be necessary.

Software changes over time. C# will grow and change, probably for some time and for several revisions after 2.0. This is a tool that you use every day, for most of your day. Learn the official definitions, and stay on top of them.
 
   

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.