Underscores as prefixes/suffixes

Hello again,

Well I’ve discussed that problem of underscores with some other developers,
and they think, like me, that it should not be a problem to use underscores in this way.
I’m used to prefix static functions with a double underscore, even private members of
C++ classes (or Java classes as well).
I’m dubious about the fact that using underscores as prefixes and suffixes of functions/variables/fields
should collide in any way with the compiler. It generates random suffixes for its internal strings,
I doubt there is a probability to be in conflict with it.

Regards

Julien

----- Message d’origine ----De : KHMan
? : A list for developers using the SDL library. (includes SDL-announce)
Envoy? le : Mercredi, 18 Juin 2008, 11h18mn 04s
Objet : Re: [SDL] SDL_Layer

julien CLEMENT wrote:

Ulrich,

Thank you for your remarks. I’ll see what I can do.
I didn’t really get you when you say:

“All names with two consecutive underscores or beginning with an underscore
followed by a capital letter are reserved and you must not use them unless
you are implementing C”

because I’m gonna implement this tool in C. I don’t know which function
names
to choose because I want the prototypes being both clear and handy. I prefer
longer names which are clear rather than short ambiguous names.
As for the prefix stuff, I think about using “SDLayer” which would shorten
most of my function prototypes.

Names like _foo or __foo are reserved for use of the C compiler or
system-level libraries. That’s why it’s okay to have _WIN32 but
it’s not okay for app-level libraries to intrude into this namespace.

[snip]
To finish, what’s your opinion about the utility of such an API ?

IMHO, let the market decide. If developers are interested and
start to adopt it, then you’d know you have a winner.

[snipped]
----- Message d’origine ----
De : Ulrich Eckhardt
? : sdl at lists.libsdl.org
Envoy? le : Mercredi, 18 Juin 2008, 7h27mn 29s
Objet : Re: [SDL] SDL_Layer
[snipped]


Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

  _____________________________________________________________________________ 

Envoyez avec Yahoo! Mail. Une boite mail plus intelligente http://mail.yahoo.fr

julien CLEMENT wrote:

Hello again,

Well I’ve discussed that problem of underscores with some other developers,
and they think, like me, that it should not be a problem to use
underscores in this way.
I’m used to prefix static functions with a double underscore, even
private members of
C++ classes (or Java classes as well).
I’m dubious about the fact that using underscores as prefixes and
suffixes of functions/variables/fields
should collide in any way with the compiler. It generates random
suffixes for its internal strings,
I doubt there is a probability to be in conflict with it.

I’m not an expert, just echoing Ulrich Eckhardt’s opinion. You can
see the reason behind our view by downloading the ISO C draft,
say, version n1256 (it’s probably n1256.pdf, something like that)
and see section 7.1.3, page 178, on “Reserved identifiers”. This
section is with respect to standard libraries provided by a C
implementation.

Obviously, you can ignore ISO C and things will still be just fine
if no identifiers collide now or in the future.–
Cheers,
Kein-Hong Man (esq.)
Kuala Lumpur, Malaysia