Tag Archives: book reviews

C++ for non-C++ developers

Some of us folks who have been coding using C++ have never left the C++ fold as other languages have come into vogue and gone out of fashion. We did take an occasional peek and try to understand what the hoopla over a new programming language was all about, and made efforts to learn concepts that we were able to successfully apply in our daily routines using the best tool for the job. As C++ programmers, we constantly remind ourselves: one size does not fit all.

These days, there is an increasing number of folks who are either moving back to coding in C++ or are beginning the process of transition into C++. While I will not delve into the reasons or motivations for their change of heart, it is worth noting the number of learning resources that are being created to cater to folks approaching C++ from other programming languages. One such resource is the book titled “C++ Succintly” written by Michael McLaughlin and published by the SyncFusion Technology Resource Portal.

Disclaimer: I reached out to Sync Fusion asking for permission to use their icons for my upcoming book. While granting permission for the same, SyncFusion asked me to review one of their books/products and as a compliment for reviewing their product; they have offered a personal key to one of their products. I must note that their offering is not affecting my review of the book.

Michael does a good job of distilling the large number of C++ features into a palatable set for the C# developers, who are the target audience for his book. He does a commendable job of mapping C++ concepts that do have C# equivalents and ones that folks are familiar with. The book starts off with an introduction to the C++ type system and then moves on to explaining namespace and functions/classes. All of these concepts are explained while contrasting them with equivalent C# constructs thereby helping the C# developer rationalize the C++ constructs.

Once the basics are explained, the focus moves to Constructors and Destructors. Object lifetimes and behavior is obviously very different in C++ when compared to GC-controlled languages and the contrast is explained using C++11 memory management smart pointers: shared_ptr, weak_ptr and unique_ptr. One of the most widely used paradigms in C++, for object destruction, is the Resource Acquisition is Initialization or the RAII pattern. This pattern is widely used in the C++ world to design well behaving programs that do not leak! When put together with object creation, destruction and a pattern to manage lifetimes, it becomes increasingly clear why C++ programmers shy away from having to use a GC. The book does a good job of explaining these concepts to C# developers.

The focus then shifts to explaining pointers: a perennial source of confusion and frustration to a lot of non-C++ developers, references and using ‘const’. All of these concepts are explained in a brief and succinct format. This chapter then leads to a discussion on strings, all the more relevant since there are a multitude of string types supported by C++: from plain char* to std::string types.

A few C++-esque idioms are introduced along the way, including the use of pre-increment operator within a ‘for’ loop, using ‘nullptr’ instead of NULL etc.

The final few chapters focus on templates, C++ lambdas, the Standard Library and finally a chapter devoted to using Microsoft Visual Studio and C++.

All in all, it is a good book for explaining C++ in a succinct format for non-C++ developers, especially for folks using C# and are probably staring at the prospects of having to use C++ in one of their upcoming projects. This book however is not an encyclopedia of C++ nor does it cover everything that is part of the modern C++ programming language. In all fairness to the author, he does make it very clear at the beginning itself, that this book does not cover everything but instead only focuses on aspects of the C++ language that folks from non-C++ world find useful and enhance their knowledge/skills. For the folks who are in the C++ realm already, there is little value in this book, unless you are not up-to-date with C++11. If you are still coding using the older C++98 style and want to get a good digest of C++11 features, definitely read this book. For non-C++ folks, this is a good “go-to” book to get you started with modern C++.

Book Review : Getting Started with Windows 8 Apps

I picked up the “Getting Started with Windows 8 Apps” by Ben Dewey recently, as part of the O’Reilly Blogger Review Program  and wanted to provide a quick review of the book here.

The book is primarily targeted at existing .NET developers who want to jumpstart their sojourn with building Windows 8 apps. The author walks through creating an application from scratch using C# and Visual Studio 2012 and walks through the paces of explaining how to integrate the app with the various OS integration points: Share, Search, Live Tiles etc.

The application design itself is geared towards using the Model-View-ViewModel (MVVM) pattern and how such a pattern can best be used while writing Windows 8 Apps using XAML and C#. I personally do not like technical books preaching the “one true way” of designing applications as I strongly believe that good, competent developers come up with designs and patterns that are applicable for their scenarios. A good technical book explains the concepts and gives enough flexibility for its readers to come up with innovative ways to incorporating the concepts in their daily work. But maybe it is just me who looks at things this way!

The book also does not explain the finer nuances of this new API, the WinRT. It looks at WinRT purely from the prism of a .NET layer. Maybe this is deliberate as the target audience for the book is existing .NET developers but I feel that explaining the WinRT from a more detailed perspective would benefit folks who are writing apps for this modern platform. After all, we just don’t want folks to move their existing code and feel happy, we also want to them to understand the platform and build truly shining apps that delight their users.

All in all, a good starting point if you are an existing C# developer who wants to jump into the world of WinRT.