The	World	of	Misprints	and	Copy-Paste
Author: Andrey Karpov
Date: 27.06.2013
Programmers make an incredibly large number o...
• V523. Meaningless "if" operators in copied-and-pasted blocks.
• V524. Functions created through using Copy-Paste.
• V529...
Upcoming SlideShare
Loading in …5
×

The World of Misprints and Copy-Paste

127
-1

Published on

Programmers make an incredibly large number of misprints, simple logical slip-ups and Copy-Paste caused mistakes. I invite you to taste them. Bon appétit!

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
127
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

The World of Misprints and Copy-Paste

  1. 1. The World of Misprints and Copy-Paste Author: Andrey Karpov Date: 27.06.2013 Programmers make an incredibly large number of misprints, simple logical slip-ups and Copy-Paste caused mistakes. I invite you to taste them. Bon appétit! Programmers tend to believe that it's very complicated and tricky bugs they spend most of their time on, while they never make simple mistakes. That's wrong, of course: they do, and these mistakes in total take much time and effort to fix. It's just that simple errors don't stick in your memory. You are more likely to remember an epic battle against a race condition that raged for a whole day. So, that's right: complicated errors may take much time to eliminate; but the point is that simple bugs in total may cause as much harm. This idea is discussed in detail in the article The second myth - expert developers do not make silly mistakes . While checking various open-source projects with PVS-Studio, I add new bugs into our bug database. This time I've picked out those diagnostics that help to detect the following sorts of bugs: slip-ups, misprints and bugs caused by incorrectly used Copy-Paste. Behold and beware. • V501. Copy-Paste and misprints in conditions. • V502. A mess with operations' priorities. • V517. Identical "if" operators because of Copy-Paste. • V519. Harmful misprints.
  2. 2. • V523. Meaningless "if" operators in copied-and-pasted blocks. • V524. Functions created through using Copy-Paste. • V529. Redundant semicolons ";". • V547. Silly mistakes like the check unsigned variable < 0. • V560. & and && so easily mixed up. • V579. The string length and the pointer size mixed up as easily. • V595. Checking pointers just for sake of it. These are just a few of the silly mistakes programmers tend to make, yet these are the most representative ones. Enjoy your reading. The complete list of samples can be found here.

×