-
June 15th, 2017, 07:29 AM
#1
The Evil within the Comparison Functions
Programmers are very attentive people. The specifics of their work is that even one typo can break the logic of the whole program. Such errors can be detected by specialized code analysis tools. But still, it would be very interesting to see if there are any error patterns: what errors appear in functions most often? Well, one C/C++ developer, a Microsoft MVP, decided to find an answer for this question.
As it turned out, one of the most frequent errors occurs in simple comparison functions: IsEqual, Equals, Compare, AreEqual and so on, ot in overloaded operators, such as ==, !=. At first glance it may seem that the comparison functions are so simple and trivial, that they don’t need any unit tests or checks by additional code analysis tools, but perhaps, developers just underestimate them, thinking that they are too banal. You may see this phenomenon in the article “The Evil within the Comparison Functions”.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|