Re: Fwd: Compiler Guided Refactoring.
Richard <[email protected]> Mon, 08 Jul 2013 12:27:30 -0600
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Organization | multi-cellular, biological |
| Message-ID | <[email protected]> |
In article <CAEyOLyB+NPY-zhMGSG_F7NHJgPYsqsUHjkAYoOD5D4sejYYcSQ@mail.gmail.com>,
J Arrizza <[email protected]> writes:
> Further to this, one additional refactoring I've used is Rename Variable to
> add a "g" prefix to all global variables. I personally don't like hungarian
> notation but adding the "g" is a very useful exception to this rule. All
> the globals show up clearly in the code.
Strictly speaking, this isn't Simonyi (i.e. "Hungarian") notation,
which encodes the type of the variable into it's name:
int i_foo;
You're annotating the name with it's visibility scope. This is often
done by many people for global ("g_" prefix), static ("s_"), and member
("m_") data. In C#, we would often use "_" prefix for class member
variables. In Java, the cultural convention seems to be to not use
any prefix for member data at all. In C++, identifiers beginning with
underscore followed by a capital letter or another underscore are reserved
by the standard, so the tendency has been to use "g_", "s_" and "m_"
even if Simonyi notation is not used, avoiding a leading underscore
altogether.
--
"The Direct3D Graphics Pipeline" free book <http://tinyurl.com/d3d-pipeline>
The Computer Graphics Museum <http://computergraphicsmuseum.org>
The Terminals Wiki <http://terminals.classiccmp.org>
Legalize Adulthood! (my blog) <http://legalizeadulthood.wordpress.com>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/refactoring/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/refactoring/join
(Yahoo! ID required)
<*> To change settings via email:
[email protected]
[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/