While C++11 is with us for a decade now, it’s good to go back and recall some of its best features. Today I’d like to consider override and final keywords which add a crucial safety when you build class hierarchies with lots of virtual member functions.
See how to prevent common bugs, and how to leverage tools to make your code safer.
Last time in A Debugging Tip: Write Custom Visualizers in Visual Studio, I introduced the Visual Studio’s Natvis Framework and showed you a couple of samples. That article was just a basic introduction, and now it’s time to see more experiments.
Learn From Existing Code First of all, we can examine existing code that is shipped with Visual Studio and see how it works.
In Visual Studio, when you work with types from the C++ Standard Library or other common APIs, you might be familiar with a concise view of those objects in debugger. You can hover a mouse over an entity, and then the debugger presents short information about their current state. For example:
Since a few months, I’ve been refactoring my old C++/OpenGL project. Thus far, I used compilers (MSVC and Clang), my knowledge or free tools. At some point, I also got a chance to leverage a solid static analysis tool - PVS-Studio. The tool helped me with identifying 8 critical issues not to mention good code style and performance enhancements (in total 137 warnings)
Comments in code might not only be some text floating around the functions, variables and classes, but they might contain some extra semantic information. With this improvement, you can navigate through projects much faster or even organize your knowledge. In this blog post, I’ll show you two ways on how to add extra metadata to comments in Visual Studio.
In this blog post, I’d like to show you how I could quickly improve my old project with Modern C++. Thanks to using the newest compilers and free code analysis checkers you can cover and modernise a lot of code.
Intro If you have a terrible code like:
float* pfloats = new float; // no delete  later!
To write a professional C++ application, you not only need a basic text editor and a compiler. You require some more tooling. In this blog post, you’ll see a broad list of tools that make C++ programming possible: compilers, IDEs, debuggers and other.
Last Update: 14th October 2019.
Note: This is a blog post based on the White Paper created by Embarcadero, see the full paper here: C++ Ecosystem White Paper.
A few weeks ago I gave another talk at my local C++ user group. We discussed recent “goodies” from C++ and tools that can increase productivity.
Intro In my post for the “C++ summary at the end of 2017” I mentioned that we could see a considerable improvement in the area of tooling for the language.
Do you write code 100% of your job time?
I’m guessing the answer is no. Ignoring the whole management part, meetings, coffee, youtube, cats, etc, even if you’re sitting at your keyboard you’re not typing all the time. So what else are you doing?
The short answer: you’re probably figuring out what to write and where to add new features (and what to fix)… so you’re mostly reading and trying to understand the code.
Fixed 1 out of 99 bugs in a project. 117 to go…
Have you experienced something similar? Although it’s impossible to write bug-free code, there are tools and practices to lower the rate of mistakes.
Today, I’d like to run through a gigantic list of freely available resources from the PVS-Studio Team who works with bugs analysis on a daily basis.
How does your typical coding session in Visual Studio look like?
What’s the first thing you do when you’re about to start coding?
Yes… let’s check Gmail, Youtube, Reddit, etc… :)
OK, please be more professional!
So, let’s assume my Visual Studio (2013, 2015 or 2017) is already started. What to do next?
Around one and a half year ago I did some benchmarks on updating objects allocated in a continuous memory block vs allocated individually as pointers on the heap: Vector of Objects vs Vector of Pointers. The benchmarks was solely done from scratch and they’ve used only Windows High Performance Timer for measurement.