News
11/15/2015
12:06 PM

C++ Code Optimization: 10 Tips And Tricks

C++ is a great enterprise programming language if you know how to get the most from its arcane features. Here are 10 tips to help you do so, and end up with high-performing applications for your business.



When it comes to enterprise programming, C++ reigns supreme. That's one of the reasons why figuring out how to write the best C++ code possible is a hot topic on the Web. Another reason programmers come together to figure out best practices for C++ programming is the nature of the language itself. C++ gets its underlying structure from C, exists in multiple versions, and is wildly configurable and extensible. It is possible to use those qualities to write compact, efficient, elegant code in C++. It's equally possible to use those qualities to write a resource-devouring mess.

There are a lot of ways to nibble at the problem of bad C++ code. If you don't believe me, a quick Google search will prove the point. But which tips can have a larger impact on code quality? I took a look and came up with 10 that I believe might make a difference in the way your code behaves and the impact it has on the system as a whole.

[ Just getting started? Read 10 Top Programming Languages For Learning To Code.]

It's important to note that two of the tips in this article could apply to any programming language. They don't even require a computer. The rest, though, assume that you're actually writing some code in C++ and have the ability to compile it into executable code. Two of these are concerned with how you compile your code, leaving six that deal with the code you write.

As I mentioned upfront, these are suggestions that I think will have a real impact on your work. They're among thousands of tips that exist. Once you've reviewed them, tell me whether you think they're some of the best? I'd love to hear your thoughts and exchange some practical information with you in the comments section below. Which tactics and techniques have helped your code? Who knows, maybe you'll be featured in a future "how we code" article right here at InformationWeek.

**New deadline of Dec. 18, 2015** Be a part of the prestigious InformationWeek Elite 100! Time is running out to submit your company's application by Dec. 18, 2015. Go to our 2016 registration page: InformationWeek's Elite 100 list for 2016.

Curtis Franklin Jr. is Senior Editor at Dark Reading. In this role he focuses on product and technology coverage for the publication. In addition he works on audio and video programming for Dark Reading and contributes to activities at Interop ITX, Black Hat, INsecurity, and ... View Full Bio

We welcome your comments on this topic on our social media channels, or [contact us directly] with questions about the site.
Comment  | 
Email This  | 
Print  | 
RSS
More Insights
Copyright © 2020 UBM Electronics, A UBM company, All rights reserved. Privacy Policy | Terms of Service