In 2000,Microsoft announced the C# programming language. C# has roots in the C, C++ and Java programming languages. It has similar capabilities to Java and is appropriate for the most demanding app-development tasks, especially for building today’s large-scale enterprise apps, and web-based, mobile and “cloud”-based apps.
C# is object oriented—we’ve discussed the basics of object technology and will present a rich treatment of object-oriented programming throughout the book. C# has access to the powerful .NET Framework Class Library—a vast collection of prebuilt classes that enable you to develop apps quickly (Fig. 1.3). We’ll say more about .NET in Section 1.9.
1.8.2 Event-Driven Programming
C# is event driven. You’ll write programs that respond to user-initiated events such as mouse clicks, keystrokes, timer expirations and—new in Visual C# 2012—touches and finger swipes—gestures that are widely used on smartphones and tablets.
1.8.3 Visual Programming
Microsoft’s Visual C# is a visual programming language—in addition to writing program statements to build portions of your apps, you’ll also use Visual Studio’s graphical user interface (GUI) to conveniently drag and drop predefined objects like buttons and textboxes into place on your screen, and label and resize them. Visual Studio will write much of the GUI code for you.
1.8.4 An International Standard; Other C# Implementations
C# has been standardized internationally. This enables other implementations of the language besides Microsoft’s Visual C#, such as Mono (www.mono-project.com) that runs on Linux systems, iOS (for Apple’s iPhone, iPad and iPod touch), Google’s Android and Windows.
1.8.5 Internet andWeb Programming
Today’s apps can be written with the aim of communicating among the world’s computers. As you’ll see, this is the focus of Microsoft’s .NET strategy. In Chapters 23, 29 and 30, you’ll build web-based apps with C# and Microsoft’s ASP.NET technology.
1.8.6 Introducing async/await
In most programming today, each task in a program must finish executing before the next task can begin. This is called synchronous programming and is the style we use for most of this book. C# also allows asynchronous programming in which multiple tasks can be performed at the same time. Asynchronous programming can help you make your apps more responsive to user interactions, such as mouse clicks and keystrokes, among many other uses.
Asynchronous programming in previous versions of Visual C# was difficult and error prone. Visual C# 2012’s new async and await capabilities simplify asynchronous programming, because the compiler hides much of the associated complexity from the developer. In Chapter 28, we’ll provide a brief introduction to asynchronous programming with async and await.
1.8.7 Other Key Contemporary Programming Languages
Figure 1.4 summarizes some popular programming languages with features comparable to those of C#.