Objective C # principle 48: learn more about tools and resources)

Source: Internet
Author: User

Objective C # principle 48: learn more about tools and resources
Item 48: Learn about tools and resources

This is an exciting time for C # And. net. These tools are still relatively new.CommunityThey are learning how to use these tools. Some resources can help you improve your knowledge and create a larger Knowledge Community for. NET and C. These tools are recommended to C # developers every day. All the content about C # practices is still being written. Follow up with them and keep learning about the relevant content.

The first tool in the toolbox of every C # developer is nunit, which can be found on www.nunit.org. Nunit is a tool for automatic unit testing, which features similar to JUnit. Like most other developers, I hate writing tests.CodeAnd test it by yourself. Nunit makes these processes very efficient. After you use these tools regularly, you will be used to testing all your C # classes. Whenever I create a class library project, I add an nunit test project and add the automatically generated test as part of it. I add a configuration to create and run a test so that the test can be performed at each compilation. Then, I can switch the configuration of the activity to determine whether to make the unit test formal.Program. By default, I run them. When I need to perform a UI test, I will switch to another configuration.

When using nunit, you can check the nunitSource codeI learned some interesting technologies. Nunit uses some advanced reflection habits to load and test your assembly. It uses features to find test packages, test cases, and expected results for each test case (see Principle 42 ). This is a very good example. It shows you how to use these technologies to create tools that can be dynamically configured by yourself and can be widely used.

It is fxcop, which is a free tool and can be obtained from gotdotnet (www.gotdotnet.com. Fxcop analyzes the IL in your assembly to see if it violates the principles of practice and where to report such violations. Each principle has a reliable metric specification, and the reason for its use. Like all the Recommended Principles in this book, some documents have a brief reason for a certain principle. You can determine whether these actual problems comply with these suggestions. You can also configure whether to apply every principle to the project. I do not agree with some principles in fxcop, And I have explained the reason before this book. However, like nunit, fxcop can be part of the formal program you create. After each compilation, you can have a post-compilation step. You can use fxcop to analyze the principles you choose. Figure 6.1 shows an example output from fxcop. Although some recommendations are not my favorite (for example, one is to make every assembly visible to com), it is indeed a useful tool, because it allows you to think a lot about the default decisions you have made.

Figure 6.1: A project analyzed by fxcop:
Figure 6.1. fxcop analyzing a project.

[View full size image]

Ildasm is an il anti-assembler. In this book, I have demonstrated some il code, which is generated by the compiler for different C # structures. Although I don't believe many people may choose to write il Code if they have advanced languages, you should be familiar with it. Knowing the Il code generated from different C # structures can help you become a better developer. You can check the Il code for your own assembly, or the assembly in the. NET Framework. This is the use of ildasm, And it is released together with the. NET Framework SDK. Il is available for all developers. Ildasm allows you to see the intermediate language of your assembly. In any case, this is a good way to learn the. NET Framework assembly, which is also the original information.

These are only part of your official toolbox, but having these tools is just one aspect of improving your skills. A large number of online resources and communication communities allow you to participate and learn, and increase your own C # And. NET Framework knowledge. The first and most important thing is the gotdotnet website (www.gotdotnet.com), which is the official website of the. NET group. C # The team has a site on msdn, which is currently in msdn.microsoft.com/vcsharp/ (which is accidentally reorganized due to changes on the msdn website ). If your work is primarily network-based, try to access www.asp.net, which is provided for ASP. NET groups. If your job is mainly based on Windows form, try www.windowsforms.net, which is the official website of the Windows form group. These websites contain many references and implementations of conventional programming, which may be desired in your applications. They are also source file components, so you can detect and modify them to make them what you want. The last and most important point should be to understand the web pages in the MS mode and practice. This webpage is currently in.
In addition, the Code and libraries of some new examples are often updated here, which may help you solve regular programming problems. When writing this, you can use 10 different application blocks to implement some common program requirements. I'm sure when you read this, there is more content in these areas.

I also recommend subscription of some FAQ in group C: Buy. Here you can find the latest list: http://msdn.microsoft.com/vcsharp/team/blogs/

If you want to learn more about the language and environment, you can detect the shared CLI (code-named rotor ). This includes the. NET Framework and some core content of the C # compiler. You can read these materials to gain a deeper understanding of every function and. NET Framework in C. Not all. Net commercial frameworks have available shared materials: for example, shared code is not released for special windows code. However, these released subsets are also enough for you to learn more about the CLR and C # languages.

C # the compiler has been released with the shared CLI, which is written in C ++ and serves as the underlying CLR code. You must have a deep understanding of C ++ and a clear understanding of compiler design. Modern Language compilers are complex software blocks, but CLR data is a useful tool to understand how the core functions of the. NET Framework are implemented.

Here is just a simple list, I just introduced a surface in many materials. You can get a lot of information in MS, other online websites, or books. The more you use these tools, the more knowledge you get. The whole. NET and C # communities are moving forward, because they are developing rapidly and the resources listed may be constantly changing. You can learn and write your own documents.

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

item 48: Learn about tools and resources
These are exciting times for C # And. net. these tools are still new enough that the entire community is learning how best to use them. several resources are available to help you improve your knowledge and build a larger community of knowledge. net and C #. these are the tools that I use daily and recommend to other C # developers. the full set of C # best practices is still being written. keep up, and get involved.

The first tool that shoshould be in every C # developer's toolbox is nunit, available on the Web at www.nunit.org. nunit is an automated unit-test tool, functionally similar to JUnit. like most developers, I hate writing tests and testing my code. nunit makes that process so efficient that using it regularly ensures that you will be in the habit of testing all your C # classes. whenever I make a class library project, I add an nunit test project and include executing the tests as part of the automatic build. I add new deployments that include build and test, which run the tests on every compile. then I can switch the Active configuration to control whether unit tests are run as part of the regular build process. by default, I run them. I switch to the other configuration when I'm running tests that require the UI.

In addition to using nunit, you can learn several interesting techniques by examining the nunit source code. nunit uses some advanced reflection idioms to load and test your assemblies. it uses attributes to find Test suites, test cases, and expected results from each test case (see item 42 ). it's a great example of how to use these techniques to build a tool that configures itself dynamically, and it can be used in a wide variety of ways.

Next is fxcop, a free tool available at gotdotnet (www.gotdotnet.com ). fxcop analyzes the IL in your assembly against a set of rules and best practices, and reports violations. each rule has a reliability metric and a reason for the rule. as with all the recommendations in this book, the rule documentation has a brief justification for the advice. you can then determine whether the advice fits your particle problem space. you can also configure whether each rule is applied in your project. I disagree with some of the fxcop rules, and I 've said as much earlier in this book. however, like nunit, fxcop can become part of your regular build process. each build can have a post-build step that analyzes the code using fxcop with your chosen rules. figure 6.1 shows a sample output from fxcop. although some of the recommendations are not to my liking (such as the one that every assembly shoshould be com visible ), it's a useful tool because it makes you think about includecisions you might have made by default.

Figure 6.1. fxcop analyzing a project.

[View full size image]

 

Ildasm is an il disassembler. in different locations in this book, I 've shown the Il that the compiler generates for different C # constructs. although I don't believe that keep people are choosing to write il in favor of any high-level language, you shoshould be familiar with it. knowing the Il that gets generated from different C # constructs will help you be a better developer. you can examine the IL for your own assemblies or for assemblies in. net Framework by using ildasm, which comes with.. NET Framework SDK. the Il is available to all developers. ildasm lets you see the intermediate language for your assemblies. however, a better way to learn about. net Framework assemblies you use is to get the source.

Those are the tools that are part of your regular toolbox. but having the tools is only one way to improve your skill. A variety of online resources and communities enables you to participant and learn and increase your knowledge of C # And. net Framework. first and foremost is the gotdotnet site (www.gotdotnet.com), the official site of. net team. the C # team has a page on the msdn site, currently located at msdn.microsoft.com/vcsharp/ (it moves occasionally as the msdn site gets reorganized ). if your work is primarily Web-based, try www.asp.net, the site for the ASP. net team. if your work is Windows formsbased, try www.windowsforms.net, the official site of the Windows Forms team. these sites contain Reference implementations of your common idioms that you will want to make use of in your applications. they all come with source components, so you can examine and modify them as you need to for your purposes. the last and most important location to become familiar with is the MS patterns & Practices page. this page is currently located at www.microsoft.com/resources/practices /. from this location, you will find common patterns and starter code for those best practices. this area continues to be updated with more sample code and libraries that will help you solve common programming problems. at this writing, you can use 10 different application blocks to implement common programming requirements; I'm sure there are already more by the time you read this.

I also recommend subscribing to the C # team FAQ: http://blogs.msdn.com/csharpfaq. in addition to that one, several of the C # team members have blogs where they discuss C # issues. you can find the up-to-date list at http://msdn.microsoft.com/vcsharp/team/blogs.

If you want to learn more and get an even deeper understanding of the language and the Environment, examine the Shared Source CLI (code-named rotor ). this operator des the core. net Framework and a C # compiler. you can read the source code to gain an even deeper understanding of each feature in the C # language and. net Framework. not every assembly in the specified cial. net Framework is available in the Shared Source version: for example, the windows-specific code is not delivered with the shared source code. however, what is delivered is a rich subset that you can use to learn much about the inner workings of the CLR and the C # language.

The C # compiler delivered with the Shared Source CLI is written in C ++, as is part of the low-level CLR code. you need to have a strong background in C ++ and a strong understanding of compiler design to understand it thoroughly. modern-language compilers are intricate pieces of software, but the CLR source is a valuable tool to understand how the core features in. net Framework are implemented.

This is intentionally a small list. I 've only touched the surface of the specified resources that are available to you from Microsoft, online at other sites, and in books. the more you use these tools, the more knowledgeable you will be. the entire C # And. net community is moving forward. because it's moving forward quickly, the list of resources changes constantly. learn and contribute yourself.

 

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.