Top 10 bugs in C++ open source projects, checked in 2016

While the world is discussing the 89th Ceremony of Oscar award and charts of actors and costumes, we’ve decided to write a review article about the IT-sphere. The article is going to cover the most interesting bugs, made in open source projects in 2016. This year was remarkable for our tool, as PVS-Studio has become available on Linux OS. The errors we present are hopefully, already fixed, but every reader can see how serious are the errors made by developers.

Picture 6 Continue reading

Top 10 C# projects errors found in 2016

To measure the efficiency of our analyzer, and also to promote the methodology of static analysis, we regularly analyze open source projects for bugs and write articles about the results. 2016 was no exception. This year is especially important as it is the year of the “growth” of the C# analyzer. PVS-Studio has obtained a large number of new C# diagnostics, an improved virtual values mechanism (symbolic execution) and much more. Based on the results of our teamwork, I compiled a kind of chart of the most interesting bugs, found in various C# projects in 2016.

Picture 3

Continue reading

The real difference between struct and class

“Should I use a struct or a class?”

Such is the question many C++ programmers ask themselves, or ask around to more experienced co-workers, when designing their code.

coding

There is sometimes a cloud of misconception about what the difference between struct and class technically is, particularly amongst the youngest developers. And once we get to understand the technical difference, some degree of uncertainty often remains about which one to use in a given context. Sometimes developers even disagree about which is the more appropriate in their code.
Continue reading

An intriguing C++ quiz that might challenge you more than you think

The author of the blog “banterly.net” was recently looking through his university days archive and came across this following problem that he created for himself trying to understand how C++ inheritance works. It was not obvious to him back then and he remember that even for TAs and some developers it was not very clear what was the deal, with some getting the answer right but not the why.He still find it intriguing today so I decided to share it, hoping that it may also be intriguing for others.

Continue reading

The Evil within the Comparison Functions

Perhaps, readers remember my article titled “Last line effect”. It describes a pattern I’ve once noticed: in most cases programmers make an error in the last line of similar text blocks. Now I want to tell you about a new interesting observation. It turns out that programmers tend to make mistakes in functions comparing two objects. This statement looks implausible; however, I’ll show you a great number of examples of errors that may be shocking to a reader. So, here is a new research, it will be quite amusing and scary.

Picture 2

Continue reading