c编程40外文翻译(编辑修改稿)内容摘要:

close relationship with the .NET Framework is that working with framework features such as the class library feels very natural. The .NET Framework Class Library Working in C means more than using just the languagethe classes offered by the .NET Framework are an extremely important part of the C developer’s everyday experience (and they account for a lot of this book’s content). Most of the library functionality falls into one of three categories: utility features written in .NET, wrappers around Windows functionality, and frameworks. The first group prises utility types such as dictionaries, lists, and other collection classes, as well as string manipulation facilities such as a regular expression engine. There are also features that operate on a slightly larger scale, such as the object models for representing XML documents. Some library features are wrappers around underlying OS functionality. For example, there are classes for accessing the filesystem, and for using work features such as sockets. And there are classes for writing output to the console, which we can illustrate with the obligatory first example of any programming language book, shown in Example 11. Example 11. The inevitable “Hello, world” example class Program { static void Main(){ (Hello, world)。 } } We’ll examine all the pieces shown here in due course, but for now, note that even this simplest of examples depends on a class from the librarythe class in this caseto do its job. Finally, the class library offers whole frameworks to support building certain kinds of applications. For example, Windows Presentation Foundation (WPF) is a framework for building Windows desktop software。 (which is not an acronym, despite appearances) is a framework for building web applications. Not all frameworks are about user interfacesWindows Communication Foundation (WCF) is designed for building services accessed over the work by other puter systems, for instance. These three categories are not strict, as quite a few classes fit into two. For example, the parts of the class library that provide access to the filesystem are not just thin wrappers around existing Win32 APIs. They add new objectoriented abstractions, providing significant functionality beyond the basic file I/O services, so these types fit into both the first and second categories. Likewise, frameworks usually need to integrate with underlying services to some extent— for example, although the Windows Forms UI framework has a distinctive API of its own, a lot of the underlying functionality is provided by Win32 ponents. So the three categories here are not strict. They just offer a useful idea of what sorts of things you can find in the class libraries. Language Style C is not the only language that runs on the .NET Framework. Indeed, support for multiple languages has always been a key feature of .NET, reflected in the name of its runtime engine, the CLR or Common Language Runtime. As this name implies, .NET is not just for one language—numerous languages have access to the services of the .NET Framework class library. Why might you choose C over the others? We already mentioned one important reason: C was designed specifically for .NET. If you are working with .NET technologies such as WPF or , you’ll be speaking their language if you work in C. Compare this with C++, which supports .NET through extensions to the original language. The extensions are carefully thought out and work well, but code that uses .NET libraries just looks different from normal C++, so programs that bridge the worlds of .NET and standard C++ never feel pletely coherent. And the dual personality often presents dilemmasshould you use standard C++ collection classes or the ones in the .NET class library, for example? In native .NET languages such as C, such questions do not emerge. But C is not unique in this respect. Visual Studio 2020 ships with three languages designed for .NET: C, , and F. (Although follows on from its Visual Basic predecessors, it was radically different in some important ways. It is a native .NET language with a VBlike syntax rather than VB 6 with .NET capabilities bolted on.) The choice between these languages es down to what style of language you prefer. F is the odd one out here. It’s a functional programming language, heavily influenced by a language called ML. Back in 1991, when your authors were firstyear students, our university’s puter science course chose ML for the first programming language lectures in part because it was so academic that none of the students would previously have e across anything like it. F is still at the academic end of the spectrum despite having climbed far enough down the ivory tower to be a standard part of a mainstream development environment. It excels at plicated calculations and algorithms, and has some characteristics that can help with parallel execution. However, as with many functional languages, the cost of making some hard problems easier is that a lot of things that are easy in more traditional languages are remarkably hard in F functional languages are adept at plex problems, but can be clumsy with simple ones. It seems likely that F will mostly be used in scientific or financial applications where the plexity of the putation to be performed dwarfs the plexity of the code that needs to act on the results of those calculations. While F feels distinctly other, and C have a lot of similarities. The most obvious factor in choosing between these is that is easier to learn for。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。