The joy of C

This one is one of my favourites - Comparing strings. The logic is simple: the function returns 0 if the strings are equal. The problem is that people code it like: if (!strcmp(x,y)), so a casual read can completely misinterpret the intent.
Explicit comparisons please people! This is one of those things that I'm glad does not happen in the more B&D languages.

About this Entry

This page contains a single entry by Pete Shanahan published on July 27, 2005 5:26 PM.

Microsoft's spot the bug was the previous entry in this blog.

Keeping in shape is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.