Ian Griffiths’ new book is for “experienced developers,” not for beginners hoping to learn the basics of programming while also learning C#. The focus is “Building Windows 8, Web, and Desktop Applications for the .NET 4.5 Framework.”
Earlier editions in the Programming C# series have “explained some basic concepts such as classes, polymorphism, and collections,” Griffiths notes. But C# also keeps growing in power and size, which means the page counts of its how-to manuals must keep growing, too, to cover “everything.”
The paperback version of Programming C# 5.0 weighs in at 861 pages and more than three pounds. So Griffiths’ choice to sharpen the book’s focus is a smart one. Beginners can learn the basics of programming in other books and other ways before digging into this edition. And experienced developers will find that the author’s explanations and code examples now have space to go “into rather more detail” than would have been possible if chapters explaining the basics of programming had been packed in, as well.
If you have done some programming and know a class from an array, this book can be your well-structured guide to learning C#. The “basics” are gone, but you still are shown how to create a “Hello World” program—primarily so you can see how new C# projects are created in Visual Studio, Microsoft’s development environment.
C# has been around since 2000 and “can be used for many kinds of applications, including websites, desktop applications, games, phone apps, and command-line utilities,” Griffiths says.
“The most significant new feature in C# 5.0,” he emphasizes, “is support for asynchronous programming.” He notes that “.NET has always offered asynchronous APIs (i.e., ones that do not wait for the operation they perform to finish before returning). Asynchrony is particularly important with input/output(I/O) operations, which can take a long time and often don’t require any active involvement from the CPU except at the start and end of an operation. Simple, synchronous APIs that do not return until the operation completes can be inefficient. They tie up a thread while waiting, which can cause suboptimal performance in servers, and they’re also unhelpful in client-side code, where they can make a user interface unresponsive.”
In the past, however, “the more efficient and flexible asynchronous APIs” have been “considerably harder to use than their synchronous counterparts. But now,” Griffiths points out, “if an asynchronous API conforms to a certain pattern, you can write C# code that looks almost as simple as the synchronous alternative would.”
If you are an experienced programmer hoping to add C# to your language skills, Ian Griffiths’ new book covers much of what you need to know, including how to use XAML (pronounced “zammel”) “to create applications of the [touch-screen] style introduced by Windows 8” but also applications for desktop computers and Windows Phone.
Yes, Microsoft created C#, but there are other ways to run it, too, Griffiths adds.
“The open source Mono project (http://www.mono-project.com/) provides tools for building C# applications that run on Linux, Mac OS X, iOS, and Android.”
– Si Dunn