May 2013 coding style discussion thread
<<< Split from http://cboard.cprogramming.com/c-pro...rs-struct.html >>>
Quote:
Originally Posted by
rcgldr
I seriously doubt that whether or not typedefs are in upper or lower case is going to cause confusion. There are already inconsistencies depending on the environment, for example, BYTE and DWORD in upper case while size_t is in lower case. Most Windows functions are mixed case, like CreateFile(), ... while std stuff is lower case, printf(), vector, ... .
You haven't been around the block enough. Essentially your argument amounts to "there is already inconsistency, so a bit more won't hurt".
Those "inconsistencies" you describe do contribute to confusion. Feeding those inconsistencies within your own coding style certainly does not reduce confusion. Humans cope with inconsistency, find ways to manage or work-around inconsistencies, and find ways to impose consistency. They do this because inconsistency is not an attribute that contributes to any improvement in human comprehension and human productivity. Quite the reverse.
You might get away with a haphazard approach in small developments - like homework exercises. The problem is that what you can get away with in small developments causes considerable problems in larger developments. In larger developments, the impacts of inconsistency are commensurately larger (in formal language, the impacts grow faster than linearly with various measures of program size), and you will not get away with them.