C++? Are You Crazy?
About two years ago, programmer Dan Egnor posted to advogato.org with the question, “Why don't C++ and free software mix?” He pointed out that freedom-loving software developers tend to stay away from C++.
But, he added, although C++ is a big complicated language with “terrible pitfalls and simple misfeatures”, it is standardized and offers good flexibility and performance. And, he wrote, “its standard library includes the STL, which knocks the socks off anything available in the C world for power, flexibility and efficiency.”
Or, does C++, as many have argued, represent the worst of both worlds, an infertile middle ground between the simplicity and control of C and the almost-automatic everything of Perl and Python?
Today, though, it might be time for a second look at this much-maligned language. For two big reasons books on standard C++, templates and all, are on my to-read stack above the more tempting ones on the next great scripting languages. First, the tools are good. The C++ support in the GNU Compiler Collection (GCC) is being actively cleaned up, with binaries getting smaller and version 3.2 offering a stable application binary interface (ABI) that will help with deploying software written in C++.
Besides GCC, a lot of other good tools are available to help with C++, as Cal Erickson points out on page 34. Cal does embedded development and that article is in the Embedded section, but his development strategy—get as much as possible working on your workstation first—means that the article will be useful to any C++ programmer.
Second, new or newly freed C++ projects, such as the Xerces XML parser contributed by IBM, mean that your new C++ code can draw on a lot of already tested, supported functionality. See John Dubchak's article on page 50 for an example. As more corporations start sharing in-house code, corporate technical preferences such as C++ start to be more important on the outside.
If you're looking for a place to apply your software development skills, Len Kaplan has a great one—your local museum. On page 89 he covers the unique challenges and rewards of creating applications for museum exhibits. And, you might pick up some C++ and XML hints from that article, too.
Another school of thought favors doing object-oriented programming in C. For an example of how that is happening in the kernel, see Greg Kroah-Hartman's Driving Me Nuts column on page 28. Your brain is inside your head, so people won't see the stretch marks on it from reading his code.
But speaking of brains, don't worry. We couldn't let the development issue slip by without at least one regular C article, and you'll be happy to know that the performance-critical parts of interpreting the brain waves of the test subject on the cover are in C. Enjoy Sam Clanton's Matlab-to-C porting advice on page 56.
Don Marti is editor in chief of Linux Journal.
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems
Join editor Bill Childers and Bit9's Paul Riegle on April 27 at 12pm Central to learn how to keep your Linux systems secure.
Free to Linux Journal readers.Register Now!
|diff -u: What's New in Kernel Development||Aug 20, 2014|
|Security Hardening with Ansible||Aug 18, 2014|
|Monitoring Android Traffic with Wireshark||Aug 14, 2014|
|IndieBox: for Gamers Who Miss Boxes!||Aug 13, 2014|
|Non-Linux FOSS: a Virtualized Cisco Infrastructure?||Aug 11, 2014|
|Linux Security Threats on the Rise||Aug 08, 2014|
- diff -u: What's New in Kernel Development
- Security Hardening with Ansible
- NSA: Linux Journal is an "extremist forum" and its readers get flagged for extra surveillance
- Monitoring Android Traffic with Wireshark
- Tech Tip: Really Simple HTTP Server with Python
- Readers' Choice Awards 2013
- RSS Feeds
- [<Megashare>] Watch Mrs Brown's Boys Movie Online Full Movie HD 2014
- Cooking with Linux - Serious Cool, Sysadmin Style!
- Senior Perl Developer