Programming C# 5.0 – Excellent how-to guide for experienced developers ready to learn C# – #bookreview

Programming C# 5.0
Ian Griffiths
(O’Reilly, paperbackKindle)

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 ( provides tools for building C# applications that run on Linux, Mac OS X, iOS, and Android.”

Si Dunn

For more information:  paperback – Kindle


Think Like a Programmer: An Introduction to Creative Problem Solving – #programming #bookreview

Think Like a Programmer: An Introduction to Creative Problem Solving
V. Anton Spraul
(No Starch Press, paperbackKindle)

Often, we “solve” problems by avoiding them. For example, if we have a clunker car, we trade it in and get a new one. Problem “solved” simply by putting a shiny new sedan in the driveway.

In software programming, however, problems generally have to be fixed, not avoided. Typically, you can’t kick a major bug to the curb and make it disappear just by adding a new function or screen. Whatever is wrong has to be repaired. And most of us are not mentally wired to quickly spout new source code that solves the dilemma.

“Problem solving is hard,” V. Anton Spraul states. And his well-structured, well-written book aims to help us rewire our heads and get a better handle on fixing problems in software.

“When solving a problem with a program, you…have constraints,” he writes. “Common constraints include the programming language, platform (does it run on a PC, or an iPhone, or what?), performance (a game program may require graphics to be updated at least 30 times a second, a business application might have a maximum time response to user input), or memory footprint. Sometimes the constraint involves what other code you can reference: Maybe the program can’t include certain open-source code or maybe the opposite—it can use only open source.”

He adds: “For programmers, then, we can define problem solving as writing an original program that performs a particular set of tasks and meets all stated constraints.”

But beginning programmers often focus too much time and effort on just making the program perform the required tasks. They don’t pay enough attention to staying within the required constraints, as well.

Think Like a Programmer begins with general strategies for solving problems and puzzles. Then it gets specific for programmers with a series of well-focused chapters:

  • Solving Problems with Arrays
  • Solving Problems with Pointers and Dynamic Memory
  • Solving Problems with Classes
  • Solving Problems with Recursion
  • Solving Problems with Code Reuse

The final chapter, “Thinking Like a Programmer,” shows how to develop a master plan that you can use “for attacking any programming problem.”

Think Like a Programmer: An Introduction to Creative Problem Solving offers a number of challenging exercises in its chapters, and the author encourages readers to attempt each one. But he provides no convenient answers at the back of the book – just as you will experience in real-life programming: no convenient answers to problems and puzzles.

One drawback for this book is that its code examples are all written in C++.

“C++ was selected for a number of reasons,” the author states. He lists several that make good sense and concludes: “…C++ is a great choice because once you have learned to solve problems in C++, you have learned to solve problems in any language. Many programmers have discovered how the skills learned in one language easily apply to other languages, but this is especially true for C++ because of its cross-paradigm approach and, frankly, because of its difficulty. C++ is the real deal—it’s programming without training wheels. This is daunting at first, but once you start succeeding in C++, you ‘ll know that you’re not going to be someone who can do a little coding—you’re going to be a programmer.”

Si Dunn

Introducing Regular Expressions – Finding your perfect match…in strings – #bookreview

Introducing Regular Expressions
Michael Fitzgerald
(O’Reilly, paperbackKindle)

“Regular expressions are specially encoded text strings used as patterns for matching sets of strings,” Michael Fitzgerald writes in this example-rich new book that focuses on learning by doing.

Veteran programmers who work with Perl, Java, JavaScript, C# and a number of Unix utilities often consider regular expressions to be an important part of their toolkit. Ruby 1.9 and Python 3 also support regular expressions.

“Regular expressions have a reputation for being gnarly,” Fitzgerald notes. However, using the online Regexpal JavaScript regular expression tester, he shows you how to dive right into the very basics and start working your way up.

He introduces several other applications that let you work with regular expressions. And his chapters smoothly take you from matching single digits to matching text strings, number strings, boundaries such as the beginnings or endings of words, character classes, and beyond, including white-space patterns and Unicode. He also shows how to perform some fairly esoteric operations such as “negative lookaheads,” where you verify that a certain pattern of text or digits does not appear in a string ahead of certain other text, numbers, or other qualifiers.

The 136-page book has ten chapters:

  1. What Is a Regular Expression?
  2. Simple Pattern Matching
  3. Boundaries
  4. Alternation, Groups, and Backreferences
  5. Character Classes
  6. Matching Unicode and Other Characters
  7. Quantifiers
  8. Lookarounds
  9. Marking Up a Document with HTML
  10. The End of the Beginning

An appendix provides a regular expression reference, listing such items as control characters, Unicode whitespace characters, metacharacters, and others. There is also a glossary of regular expression terms, such as “greedy match” and “zero-width assertions.”

Fitzgerald recommends his book for those who are “new to regular expressions or programming…the reader who has heard of regular expressions and is interested in them but who really doesn’t understand them yet.”

Those who are a bit beyond the beginner level, however, likewise can benefit from Introducing Regular Expressions and its handy examples and how-to summaries.

Si Dunn

Oh, Say Can You C#? – C# 5.0 in a Nutshell & C# 5.0 Pocket Reference -#programming #bookreview

O’Reilly recently has released two handy and helpful books for practitioners and students of the C# object-oriented programming language. One is a hefty, 1042-page “definitive reference” that (in paperback format) can double as a handy weight for physical exercise. The other is a compact, 215-page reference that really does fit in a coat pocket or pants pocket (but not a typical shirt pocket, unless you happen to wear an XXL, or larger, shirt).

Starting first with the muscle-building reference guide that weighs in at nearly three pounds…

C# 5.0 in a Nutshell, 5th Edition
Joseph Albahari and Ben Albahari
(O’Reilly, paperback, list price $49.99; Kindle edition, list price $39.99)

This latest Nutshell edition covers C# 5.0, “the fourth major update to Microsoft’s flagship programming language, an update that positions C# “as a language with unusual flexibility and breadth,” the authors state.

They note: “At one end, it [C#] offers high-level abstractions, such as query expressions and asynchronous continuations, while at the other end, it provides low-level power through constructions such as custom value types and the optional use of pointers.”

The revised and expanded new edition “covers C#, the CLR [Common Language Runtime], and the core Framework assemblies. The authors have chosen this focus “to allow space for difficult topics such as concurrency, security and application domains—without compromising depth or readability.” It’s hard to argue with the “depth” of a book 1,000+ pages long. And the book is written clearly, with numerous short code examples to illustrate its points.

C# 5.0 in a Nutshell is aimed at readers with intermediate to expert knowledge of programming, but no prior knowledge of C# is assumed. Indeed, chapters two through four provide an introduction to C# basics, starting just above the “Hello, World” level with a program that multiplies 12 times 30. The remaining chapters cover advanced C# 5.0 topics and the core .NET framework. With just a few exceptions, you can read these chapters randomly.

The hefty book has a hefty index. It has been “shaped by more than 20 expert reviewers,” including several from Microsoft. And the authors have solid backgrounds in their subject matter.

And now, for something a bit lighter…

C# 5.0 Pocket Reference
Joseph Albahari and Ben Albahari
(O’Reilly, paperback, list price $19.99; Kindle edition, list price $11.99)

The Nutshell authors have boiled their big book down to a very practical aid that you can easily carry to work, class or your favorite coffee shop or when traveling. Conveniently, the Pocket Reference still includes an introduction to C# 5.0’s fundamentals, starting with the simple multiplication program. It also covers many advanced topics, ranging from operator overload and Language Integrated Query (LINQ) to preprocessor directives, custom attributes, and XML documentation.

This book is not organized by chapters, so you will find yourself making frequent use of the book’s two-page table of contents and 12-page index, particularly if you are new to C# 5.0.

But you can readily find brief explanations, code samples and illustrations that define and clarify much of what you are seeking. And you will appreciate the book’s convenient size.

Si Dunn

Inside Windows Debugging: Practical Debugging and Tracing Strategies – #bookreview #in #programming

Inside Windows Debugging: Practical Debugging and Tracing Strategies
Tarik Soulami
(Microsoft Press,
paperback, list price $39.99; Kindle edition, list price $31.99)

Debugging and tracing tools — and the willingness and strategies to use them — should be key aspects of any software development and testing process.

Inside Windows Debugging is intended for software engineers who want to “perfect their mastery of Windows as a development platform through the use of debugging and tracing tools.”

Yet anyone serious about learning, using and supporting Windows can benefit from this book. Its first few chapters provide basic explanations of debugging and tracing tools and how to acquire the right packages and use them. From there, the author presents and explains numerous code examples that demonstrate many types of bugs and related problems in software. So it is helpful to have at least a little experience with C/C++ and C# programming languages.

Inside Windows Debugging has 560 pages, including an extensive index, and is divided into three parts: (1) “A Bit of Background”; (2) “Debugging for Fun and Profit”; and (3) “Observing and Analyzing Software Behavior.” Two appendices sum up common debugging tasks and show how to accomplish them using the WinDbg debugger.

To run the software and examples used in this book, you should have “Windows Vista or later.”

The author, however, “highly” recommends at least having Windows 7 or Windows Server 2008 R2. And in some of the kernel debugging exercises, a second computer will be needed to serve as a host kernel-mode debugger machine.

Si Dunn

Learn Microsoft Visual C# 2010 with ‘Start Here!’ Book for Beginners – #programming #bookreview

Learn Microsoft Visual C# 2010
By John Paul Mueller
(Microsoft Press, paperback, list price $34.99; Kindle edition, list price $27.99)

I like the “Start Here!” series from Microsoft Press. The books, in my view, provide a convenient, affordable and approachable way to develop some new skills in a hurry, without having to take classes.

There is nothing wrong with taking classes, of course. Most of us in America’s workforce (working or unemployed) need all of the new skills and education we can get. But if, like me, you’ve checked the prices of online classes lately and also looked at your checking account, you likely need some affordable alternatives.

If you are ready to tackle Microsoft Visual C# 2010,  you definitely can “Start Here!”, with John Paul Muller’s well-written new book.

Learn Microsoft Visual C# 2010 has been “conceived and created for the complete novice–someone who has no programming experience at all.” And it uses a hands-on approach to learning. It is not recommended for experienced programmers seeking to pick up another language.

But if you are, indeed, a complete novice to computer programming, you probably should read another “Start Here!” book first: Fundamentals of Microsoft .NET Programming by Rod Stephens. Or, at least have that book handy to read in conjunction with Learn Microsoft Visual C# 2010.

The “Fundamentals” book explains and illustrates many essential terms and concepts, such as routines, call stacks, and passing parameters. And sometimes, in Learn Microsoft Visual C# 2010, you will be referred to some of the definitions and examples found in Fundamentals of Microsoft .NET Programming.

The software download section of Learn Microsoft Visual C# 2010 may be a bit confusing for some beginners. Some of the screens and choices have changed somewhat and some have been combined since the book was published.

And while the author says “you don’t need a copy of SQL Server to work through the examples in this book,” the “Code Samples” discussion in the book’s introduction says otherwise.: “…your system should have Visual Studio 2010 and SQL Server 2008 installed.”

I left an SQL option box unchecked when setting up for my download, but I still received all of the SQL files. And, altogether, I spent a ridiculous 14 hours going through (and sometimes sleeping through) the download and installation process on a somewhat aging PC running Windows XP and a not-so-blazing wi-fi connection.

Your results will vary. So do not be in a hurry, even with a fast system. Set aside plenty of time to do things right once you start the process.

But at least all of the software tools used in this book are free. And once things are up and running, the author takes you right into the process of learning how to develop applications using C#.

His book is divided into 12 chapters:

  • Chapter 1: Getting to Know C# – Includes the Integrated Development Environment (IDE), creating and testing a Windows Forms application project, viewing its code, using Windows Presentation Foundation (WPF), creating and testing a WPF project, and viewing the code produced.
  • Chapter 2: Developing a Web Project – Focuses on developing two web applications using C#. Also shows how to download and install tools used to develop web applications.
  • Chapter 3: Using Simple Data Manipulation Techniques – Introduces data manipulation and shows how to use Language Integrated Inquiry (LINQ) to manipulate data.
  • Chapter 4: Using Collections to Store Data – Shows how to create containers to store similar data together, and explains three different types of data storage.
  • Chapter 5: Working with XML – Shows how to use eXtensible Markup Language (XML) in tasks such as saving applications settings and working with web services.
  • Chapter 6: Accessing a Web Service – Shows how to access free web services using two techniques that C# provides: Representational State Transfer (REST) and Simple Object Access Protocol (SOAP).
  • Chapter 7: Using the Windows Presentation Foundation – Focuses on using WPF to “help you create applications with impressive interfaces and new features that aren’t available using older C# development techniques.”
  • Chapter 8: Working with Libraries – Programmers try to reuse code as much as possible, to speed up the development process. This chapter shows how to create and use a library as part of  an application.
  • Chapter 9: Creating Utility Applications – “…shows how to create applications that have a command-line interface so that you can work with them quickly and automate them in various ways.”
  • Chapter 10: Using LINQ in Web Applications – Shows how to use LINQ to ask an application to supply certain types of data.
  • Chapter 11: Working with Silverlight Applications – Silverlight “works with multiple browsers and on multiple platforms”  and “can transform your C# application into something that works everywhere.” This chapter focuses on understanding “the basics of Silverlight development using C#.”
  • Chapter 12: Debugging Applications – Shows how to apply tracing techniques learned in this book to the process of finding and fixing errors.

The code samples used in the learning exercises can be downloaded from a Microsoft site. And, once you work your way through the book, the author says you may want to move up to another book, Microsoft Visual C# Step by Step.

You also may be eager to take a C# class, online or on campus, where you can learn from an instructor and fellow students.

It all depends on your resources and how committed you are to programming in C# after you “Start Here!”

Si Dunn