What do you do when your naming convention clashes with your language?

Posted by Jon Purdy on Programmers See other posts from Programmers or by Jon Purdy
Published on 2011-01-03T17:51:47Z Indexed on 2011/01/03 17:59 UTC
Read the original article Hit count: 272

Filed under:

Okay, this is one of those little things that always bugged me. I typically don't abbreviate identifiers, and the only time I use a short identifier (e.g., i) is for a tight loop. So it irritates me when I'm working in C++ and I have a variable that needs to be named operator or class and I have to work around it or use an abbreviation, because it ends up sticking out. Caveat: this may happen to me disproportionately often because I work a lot in programming language design, where domain objects may mirror concepts in the host language and inadvertently cause clashes.

How would you deal with this? Abbreviate? (op) Misspell? (klass) Something else? (operator_)

© Programmers or respective owner

Related posts about naming-conventions