Re: public global constants

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"Jeff Johnson" <i.get@xxxxxxxxxxx>'s wild thoughts were
released on Tue, 10 Jul 2007 12:55:34 -0400 bearing the
following fruit:


"greg" <greg@xxxxxxxxxx> wrote in message
news:%231uct6wwHHA.4548@xxxxxxxxxxxxxxxxxxxxxxx

how do people normally name their public global constants?

When it comes to constants I couldn't care less about scope.

I treat constants the same way as any other variable when it
comes to scope.

Either I'm using constants to represent indexes from control
arrays for example so they are only appropriate at from
level.

Or I'm using them for API calls, but I wrap up all the API
calls in a module anyway so again the constants are only
really appropriate at module level.



--
Jan Hyde

https://mvp.support.microsoft.com/profile/Jan.Hyde
.



Relevant Pages

  • Re: optimization
    ... Use outer scope when possible, ... local variables are different from locally-defined ... defined at the module level, ... I don't buy that nesting functions prevents namespace pollution. ...
    (comp.lang.python)
  • Re: portillo on the ongoing destruction of uk democracy....l
    ... Care with PR. ... account and the constitution) and within that scope give the right to ... good people do nothing trust actions not words ...
    (uk.politics.misc)
  • Re: Yet another brute force sudoku solver
    ... That is just plain wrong. ... care is needed when talking to people who only know ... languages where "global" is a scope. ... variable = object with external linkage" meaning then C has the odd ...
    (comp.lang.c)
  • Re: ::GetSystemMetrics vs GetSystemMetrics
    ... tries to match the local scope, then the class scope, and finally finds it in the global ... most of us who use:: use it to explicitly indicate "This is an API ... Does MFC step on the toes of the API? ... same-named API functions. ...
    (microsoft.public.vc.mfc)
  • Re: C# UDP MultiCast Listener
    ... initial "oversized" query is most likely due to obscurity of the Socket ... API. ... lemme try on a smaller scope, ...
    (microsoft.public.win32.programmer.networks)