Updating your C++ programming skills
Like many of you in the embedded systems design community I grew up professionally on the C language as the lingua franca of most microcontroller-based designs, especially after MCUs abandoned complex instruction sets and moved to more efficient reduced instruction set architectures.
The C language is still widely used in dedicated, resource-constrained, 8-,16-, and 32-bit designs. But for the last ten years it has had to share the stage with a slightly later programming language, C++, which its creator, Bjarne Stroustrup, originally named "C with Classes,"and incorporated object-oriented features such as classes and other enhancements. I am not abandoning my belief that the C language will remain a mainstay of many embedded designs. But I think that because C ++ is continuing to evolve and grow, it deserves more attention from embedded developers than it is presently getting.
For one thing, as many of the design articles included in this week's Tech Focus newsletter on "Effective C++ for embedded design" illustrate, it has always been possible to use C++ without the object-oriented and other features that can be costly in resource-constrained applications. Second, while the just introduced C++11/14 version of the language retains and enhances its object-oriented and concurrent programming capabilities, Stroustrup has added other non-OO capabilities that will make it more attractive to embedded developers. For more information on these capabilities I recommend "What is C++11?" and "Evolving a language in and for the real world C++ 1991-2006,” both by Stroustrup.
If you want to get the latest on C++ and where and how to use it, be sure to register to attend the 2014 ESC/EELive! conference March 31 - April 3 in San Jose, Ca, where Bjarne Stroustrup will be part of a Super C++ tutorial series that will include the following classes:
"The essence of C++," where Stroustrup examines the foundations of C++ in the context of its 2011 and 2014 updates and looks to answer such questions as: What is essential? What sets C++ apart from other languages? How do new and old features support (or distract from) design and programming relying on this essence? He will also discuss various abstraction mechanisms such as classes and templates.
"Generic Programming and Concepts," which focuses on the design of concepts and their use in C++, and provides examples of their implementation as well as a library implementation to test a design.
"Make Simple Things Simple," in which Stroustrup examines the role of simple language facilities in C++11 and its C++14 update such as auto, initializer lists, container algorithms, and range-for in the overall picture of making C++ easier to use without compromising generality and performance.
"A Design Exercise," where Stoustrup will explore a set of ideals for a sample library (a simple Matrix with associate operations) and explores the implications in terms of design choices in C++11, language features used, and techniques needed.
In addition, Stroustrup will be a part of a Q&A panel session in which he will be available to discuss issues raised in the C++ classes and how they are relevant to embedded systems programming.
To get a taste of what you can expect, here is the link to a series of his video lectures at Microsoft on C++11 and other related topics as well as a You Tube video playlist of recent Stroustrup lectures on C++. In addition, check out Bjarne Stroustrup's web page, which is an "everything you ever wanted to know" resource on C++ that I have found invaluable. Complementing this is his C++ FAQ page which I think should be used as a model of thoroughness for how such FAQ resource pages are organized.
Also, here are my Editor's Top Picks of useful Embedded.com blogs and design articles on C++ in the context of how similar functions are done in the C language:
For long term support for your C++ programming efforts, you can also take advantage of another invaluable resource, "Programming Pointers," by Embedded.com columnist Dan Saks, a widely recognized expert in C and C++.
Embedded.com Site Editor Bernard Cole is also editor of the twice-a-week Embedded.com newsletters as well as a partner in the TechRite Associates editorial services consultancy. He welcomes your feedback. Send an email to email@example.com, or call 928-525-9087.