Saturday, June 6, 2020

Free C++ tools

I love programming in C++.  I have done some professionally for over 20 years now.  Even though C++ no longer has as much market share as it once did, now is the best time to learn C++ thanks to the availability of free and useful C++ tools.  There are so many free and useful utilities that learning and effectively coding in C++ is easier than ever.  Below is a list of my favorite free C++ utilities.

Visual Studio has long been one of the best development IDEs, but what's amazing is how many improvements Microsoft is making.  They are not content to rest on their laurels.  VS2017/2019 are truly awesome platforms for development.  And with the introduction of the Community edition, the bulk of the features are available for free to everyone.  Microsoft has offered a free version of Visual Studio going to the Express edition of the early 2000s, but that version was so crippled it was of little use.  Community is so full-featured that only the most demanding of users would need to upgrade.  Microsoft is even expanding VS beyond Windows and branching into Linux and MacOS.

CppCheck is a free static code analyzer, meaning it inspects your code files looking for common mistakes.  CppCheck is surprisingly good at what it does.  If you run it against your code for the first time, you might be surprised at the problems and suggested improvements it finds.

Clang with the Clang Power Tools extension
Although I firmly believe that Microsoft's compiler is the best option for Windows, the Clang team is making significant improvements to their compiler.  That said, Clang does have at least one cool feature - ClangTidy.  Tidy is similar to CppCheck in that it analyzes your code looking for issues.  Unfortunately, Clang has no UI so it is not easy to use.  That's where the Clang Power Tools extension comes it.  It wraps the features of Clang in an ease to use UI integrated into Visual Studio.

VerySleepy
VerySleepy is a code profiler meaning you can analyze your code looking for performance bottlenecks.  I should point out that VS2017/2019 Community comes with a built-in profiler that is easy to use.  I would recommend Microsoft's profiler included with Visual Studio.  But if for any reason you can't use the Microsoft profiler, check out VerySleepy.

I'll end this list with the latest tool I've discovered.  OpenCppCoverage is a code coverage tool, meaning when you run it the tool checks which lines of code actually executed and which did not.  This is useful when testing your code, it helps you to find code that has gone untested, which means the potential for bugs is higher.  Visual Studio does have built-in code coverage, but only for higher paying customers.  The free Community edition does not offer this feature.  Fortunately this program and corresponding Visual Studio extension do a great job.