Effective C#50 Specific Ways to Improve Your C# Second Edition phần 5

Một ưu điểm khác để sử dụng cú pháp truy vấn là bạn có thể thực hiện những truy vấn song song bằng cách sử dụng các AsParallel () phương pháp. (Xem mục 35.) C # bắt đầu như một ngôn ngữ bắt buộc. Nó tiếp tục bao gồm tất cả các tính năng mà là một phần di sản đó. | This page intentionally left blank From the Library of Wow eBook 3 I Expressing Designs in C Beginners using a foreign human language can manage to communicate. They know the words and they can piece them together to get their point across. As beginners transition to experts in a language they begin to use the proper idioms in this foreign language. The language becomes less foreign and the person begins speaking more efficiently and more clearly. Programming languages are no different. The techniques you choose communicate your design intent to the developers who maintain extend or use the software you develop. C types all live inside the .NET environment. The environment makes some assumptions about the capabilities of all types as well. If you violate those assumptions you increase the likelihood that your types won t function correctly. The items in this chapter are not a compendium of software design tech-niques entire volumes have been written about software design. Instead these items highlight how different C language features can best express the intent of your software design. The C language designers added language features to more clearly express modern design idioms. The distinctions among certain language features are subtle and you often have many alternatives to choose from. More than one alternative might seem best at first the distinctions show up only later when you find that you must enhance an existing program. Make sure you understand these items well and apply them carefully with an eye toward the most likely enhancements to the systems you are building. Some syntax changes give you new vocabulary to describe the idioms you use every day. Properties indexers events and delegates are examples as is the difference between classes and interfaces Classes define types. Interfaces declare behavior. Base classes declare types and define common behavior for a related set of types. Other design idioms have changed because of the Garbage Collector. .

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.