2009年3月10日星期二

March 10th-13th Links:C#,Struct,Word,Javascript

C#
    1. What The Defference Between Const and Readonly in .NET?
    1) The readonly keywork differs from the const keyword.A const field can only be initialized at the declaration of the field.A readonly field can be initialized either at the declaration or in a constructor.
    2) A const field is a compile-time constant,the readonly field can be used for run-time constants,as in this line: public static readonly unit l = (uint)DateTime.Now.Ticks;
    3) When using const,the value has to be set before compiling,and can not be changed. Once u make your assembly,the value of the const is baked in there.if u want to change the value of the const,u must go back into your code,change the value,then recompile.if another assemly(Assembly B) wants to use the const in the first assembly(Assembly A),the const is also baked in there as well.So,if u change the value of the const,not only will you have to rebuild your first Assembly A,you will also have to build all other assembly(e.g.:assembly B,C,D...).
    4) Another difference between const and readonly,is that const are static by default,where with readonly,you must define it as static(if you wnat it to be).
    c# 2.0(which shipped with VS2005) introduced the concept of anonymous methods,which allow code blocks to be wrritten "in-line" where delegate values are expected.
    Lambda Expressions provide a more concise(简明的),functional syntax for writing anonymous methods.Since they provide a very compact and type-safe way to write functions that can be passed as arguments for subsequent evaluation.
    syntax: params => expression
    One of the things that make Lambda expressions particularly(adv尤其) powerful from a framework developer's perspective(看法) is that they can be compiled as either a code delegate(int the form of IL based method) or as a expression tree object which can be used at runtime to analyze,transform or optimize the expression.
    1) Lambda Expressions to Code Delegates
    2) Lambda Expressions to Expression Trees

Design Patterns
    If u want to do something that requires interacting with multiple subsystems you can create a facade that same only a few methods that handle all the interaction with the subsystem.

JAVASCRIPT

Silverlight
    I have been wording extensively with both WPF and Silverlight over the past many months.Not too long ago,my workstation started having trouble - specifically Visual Studio 2008 was crashing when tring to open XAML files.Not just crashing either.maybe u should need this patch:  download this patch

English
    1. Unethical
    2. Survey: 调查,民意调查
    3. reusable: 重复使用
    4. fetch: 取得
    5. paragraphs:段
    6. Enumerable: IEnumerable
    7. concise
    8. syntax
    9. subsequent: 后续的
    10. evaluation: 付值,评估,评价
    11. perspective: 看法,透视

没有评论: