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.
- Readers' Choice Awards 2013
- Linux Kernel News - November 2013
- December 2013 Issue of Linux Journal: Readers' Choice
- Mars Needs Women
- RSS Feeds
- Raspberry Pi: the Perfect Home Server
- Sublime Text: One Editor to Rule Them All?
- Advanced Hard Drive Caching Techniques
- Web Administration Scripts
- IBM Will Minimize Impact of Future Disasters
- thanks for share, great
8 hours 45 min ago
- There are factors which are
13 hours 45 min ago
- Gnome 3 ?
14 hours 30 min ago
- Reply to comment | Linux Journal
18 hours 37 min ago
- "Redis RethinkDB 4.5%" on Best NoSQL Databases
1 day 4 hours ago
- on the ground
1 day 11 hours ago
- I was able to read the whole
1 day 12 hours ago
- since i have read the title i
1 day 15 hours ago
- Belanja Online Cari Voucher Diskon
1 day 15 hours ago
- The kernel doesn't really
2 days 4 hours ago