Objective C # Part I: Summary of the First Part

Source: Internet
Author: User

The first part is the basis for language use. This is the basic skill of using the language, and it is also the most important thing that you do not pay attention to. Developing good habits is conducive to the improvement of the level in the future.

 

This part includes 11 units, respectively:

Item 1: Always use properties instead of accessible data members

Effective C #: using attributes to define private members of a class

Http://blog.csdn.net/knight94/archive/2006/06/04/772886.aspx

 

Item 2: prefer readonly to const

Effective C # Item 2: Two Methods for defining Constants

Http://blog.csdn.net/knight94/archive/2006/06/06/776548.aspx

 

Item 3: prefer the is or as operators to casts

Negative C # Item 3: Use the AS and is operators for type conversion

Http://blog.csdn.net/knight94/archive/2006/06/12/791850.aspx

 

Item 4: Use conditional attributes instead of # If

Objective C # Item 4: Use the conditional attribute to replace the IF/endif Block

Http://blog.csdn.net/knight94/archive/2006/06/18/809479.aspx

 

Item 5: always provide tostring ()

Objective C # Item 5: provides a meaningful tostring Function

Http://blog.csdn.net/knight94/archive/2006/06/18/810467.aspx

 

Item 6: distinguish between value types and reference types

Negative C # Item 6: score type and reference type

Http://blog.csdn.net/knight94/archive/2006/07/01/861383.aspx

 

Item 7: prefer immutable atomic value types

Effective C # Item 7: unchangeable atomic value types are recommended.

Http://blog.csdn.net/knight94/archive/2006/07/27/985552.aspx

 

Item 8: ensure that 0 is a valid state for value types

Effective C # Item 8: Make sure "0" is valid in the Value Type

Http://blog.csdn.net/knight94/archive/2006/08/09/1040766.aspx

 

Item 9: understand the relationships among referenceequals (), static equals (),

Instance equals (), and operator =

Objective C # Item 9: Difference and understanding of four equality Functions

Http://blog.csdn.net/knight94/archive/2006/08/11/1050901.aspx

Item 10: Understand the pitfalls of gethashcode ()

Objective C # Item 10: Be careful with the traps in the gethashcode Function

Http://blog.csdn.net/knight94/archive/2006/08/20/1100194.aspx

 

Item 11: prefer foreach Loops

Negative C # Item 11: The use of foreach statements for cyclic operations

Http://blog.csdn.net/knight94/archive/2006/08/20/1100236.aspx

 

Some good methods and the nuances of each method mentioned in the article are good. However, if you have the opportunity, we suggest you buy an original book.

 

If there is anything inappropriate in the article, or if you have any good suggestions for the article, you can send me a letter to inform me that I will pay attention to it in the next part of the compilation process. As for the progress of the next part, in order to ensure the quality of the article, I will limit the number of articles in one week to less than three.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.