S
Sandeep Sharma
For many years I have been following the convention of naming all
class attributes with a leading underscore. This enables me to
quickly identify the class attributes when I encounter them in the
source code. Even the GoF book follows this convention, although it's
true that the GoF book is not an authoritative source for coding
guidelines.
Recently a colleague remarked that using a leading underscore is a bad
programming practice that should be avoided at all costs. According
to her this has to do with the fact that the compiler naming mangling
procedure also sticks leading underscores and therefore using
underscores in the source code makes the job of following the
post-processed source code (should there ever be a need) very
difficult.
Any comments?
Regards,
Sandeep
class attributes with a leading underscore. This enables me to
quickly identify the class attributes when I encounter them in the
source code. Even the GoF book follows this convention, although it's
true that the GoF book is not an authoritative source for coding
guidelines.
Recently a colleague remarked that using a leading underscore is a bad
programming practice that should be avoided at all costs. According
to her this has to do with the fact that the compiler naming mangling
procedure also sticks leading underscores and therefore using
underscores in the source code makes the job of following the
post-processed source code (should there ever be a need) very
difficult.
Any comments?
Regards,
Sandeep