JB Enterprises - Johan BezemInterim Management & Consulting |
|
|
JB Enterprises - BlogProgramming in the C/C++ realm: Identifier names to avoid – or not?The C family of languages has been around for a while, has evolved, grown,
sprouted a few branches and now provides several paths for 'growth'.
Starting out in the seventies, standardized in the eighties, C++ in the
nineties, standardized even more recently, industry-standard variants
available for embedded (C++), and new standardization efforts on the way.
Wonderful! ui32 calculate_difference(ui32 old, ui32 new) { ... } That gave me pause. Yes, it's perfectly OK for C89, even C99 will not
complain. But do I really want to use a C++ keyword in my C code? If ever I
get to move to C++, my code must break!
So I'm now trying to find out answers to the following question: What
identifier names would I want to avoid in my code, considering the vast
realm of C/C++ language variants and dialects? So I started off with the
keywords of all standards; then I looked into the coming standards, then I
looked at the might-be keywords, packaged as macros, like complex,
imaginary, decimal64, etc. The list grew, I lost my overview, however slim
it had been, and I didn't even start on the various (Standard!) libraries!
Happy coding! November 23rd, 2009
www.bezem.de:
© 1999 – 2024 by Johan Bezem, all rights reserved. |