C++ Creator Bjarne Stroustrup Interview

We had a great talk with Bjarne Stroustrup, the designer and original implementer of C++. He is also the author of The C++ Programming Language (Fourth Edition), A Tour of C++ (Second Edition), Programming: Principles and Practice Using C++ (Second Edition), and many popular academic publications.

Enjoy the full interview below!

Virtual Function Calls in Constructors and Destructors (C++)

In different programming languages, the behavior of virtual functions differs when it comes to constructors and destructors. Incorrect use of virtual functions is a classic mistake. Developers often use virtual functions incorrectly. In this article, we"ll discuss some of these classic mistakes.

Theory    

I suppose the reader is familiar with virtual functions in C++. Let's get straight to the point. When we call a virtual function in a constructor, the function is overridden only within a base class or a currently created class. Constructors in the derived classes have not yet been called. Therefore, the virtual functions implemented in them will not be called.

COVID-19 Research and Uninitialized Variable

There is an open project, COVID-19 CovidSim Model, written in C++. There is also a PVS-Studio static code analyzer that detects errors very well. One day they met. Let's embrace the fragility of mathematical modeling algorithms and why you need to make every effort to enhance code quality.

This little story begins with an ordinary search on GitHub. While looking through the search results, I accidentally came across the COVID-19 CovidSim Model project. Without thinking twice, I decided to check it out using the PVS-Studio analyzer.

PVS-Studio: Analyzing Pull Requests In Azure DevOps Using Self-Hosted Agents

Static code analysis is most effective when changing a project, as errors are always more difficult to fix in the future than at an early stage. We continue expanding the options for using PVS-Studio in continuous development systems. This time, we'll show you how to configure pull request analysis using self-hosted agents in Microsoft Azure DevOps, using the example of the Minetest game.

pull request unicorn

Briefly About What We Are Dealing With

Minetest is an open-source cross-platform game engine containing about 200,000 lines of code in C, C++, and Lua. It allows you to create different game modes in voxel space. Supports multiplayer, and a lot of mods from community. The project repository is located here: https://github.com/minetest/minetest.

Variadic Template C++: Implementing Unsophisticated Tuple

From C++11, std::tuple is an incredible expansion to Modern C++ that offers a fixed-size col­lec­tion of het­ero­ge­neous values. Un­for­tu­nately, tu­ples can be somewhat dubious to manage in a conventional fash­ion. But, subsequently released C++ stan­dard in­tro­duced a few fea­tures and helpers that greatly re­duce the nec­es­sary boil­er­plate. 

So, in this article, I will explain the variadic template in C++ with the help of unsophisticated tuple implementation. I'll also walk you through a tricky part of tuple i.e. loop through tuple element. Because I have covered the variadic template in my prior article i.e. C++ Template: A Quick UpToDate Look, my focus here would be a blend of variadic template and tuple implementation with more up to date C++ gauges.

Dependency Inversion Principle in C++: SOLID as a Rock

Dependency Inversion Principle(in C++) is the fifth and last design principle of a series SOLID as a Rock design principles. The SOLID design principles focus on developing software that is easy to maintainable, reusable, and extendable. In this article, we will see an example code with the flow and correct it with help of DIP. We will also see guidelines and benefits of DIP at the ens of the article.

By the way, If you haven't gone through my previous articles on design principles, then check out the following quick links:

Interface Segregation Principle | SOLID as a Rock

Interface Segregation Principle in C++ is the fourth & by far the simplest design principle of a series SOLID as a Rock design principles. The SOLID design principles focus on developing software that is easy to maintainable, reusable & extendable. In this article, we will see a code violating ISP, a solution to the same code, guideline & benefits of ISP.

By the way, If you haven't gone through my previous articles on design principles, then below is the quick links:

PVS-Studio in the Clouds: CircleCI

This is a new piece of our series of articles about using the PVS-Studio static analyzer with cloud CI systems. Today we are going to look at another service, CircleCI. We'll take the Kodi media player application as a test project and see if we can find any interesting bugs in its source code.

Note. The previous articles on integrating PVS-Studio with cloud CI systems:

Commits and Pull Requests in Travis CI, Buddy, and AppVeyor Using PVS-Studio

Learn more about commits and pull requests with PVS-Studio.

Starting from version 7.04, the PVS-Studio analyzer for C and C++ languages on Linux and macOS provides a test feature that can check the list of specified files. Using this new mode, you can configure the analyzer to check commits and pull requests.

This article covers setting up the check of certain modified files from a GitHub project in popular CI systems, such as Travis CI, Buddy, and AppVeyor.

Analyzing the Code of ROOT, Scientific Data Analysis Framework

While Stockholm was holding the 118th Nobel Week, I was sitting in our office, where we develop the PVS-Studio static analyzer, working on an analysis review of the ROOT project, a big-data processing framework used in scientific research. This code wouldn't win a prize, of course, but the authors can definitely count on a detailed review of the most interesting defects plus a free license to thoroughly check the project on their own.

Introduction

ROOT is a modular scientific software toolkit. It provides all the functionalities needed to deal with big data processing, statistical analysis, visualisation, and storage. It is mainly written in C++. ROOT was born at CERN, at the heart of the research on high-energy physics. Every day, thousands of physicists use ROOT applications to analyze their data or to perform simulations.