On Thursday, September 13, 2012 9:33:32 AM UTC+3, Krice wrote:
> I'm using hungarian notation in enums, something like this:
>
> enum Ground_Tile {gtDirt, gtWater, gtMountain};
>
> I'm always told that it should be replaced with namespace.
> But I feel it's pretty much the same, only namespace
> would be Ground_Tile:
irt I guess rather than gtDirt.
Namespaces are most flexible since the qualification can be made
to disappear entirely in context where it is clear what it is.
Qualification can be made abbreviated or partial in contexts
where that is enough and it can be kept fully qualified in
contexts where same abbreviated or partially qualified version
is not clear enough.
To take your example just 'Dirt' in one context dealing only
with ground tiles is fine enough. In context where we discuss
only tiles the 'ground:

irt' and 'wall:

irt' are clear enough.
The abbreviation 'gt:

irt' might be good enough in context
where 'gt' is well known abbreviation of "ground tiles"
and is certainly not "girl talk" or "ground tactic". Far away
of such contexts the most safe representation would be to have
fully qualified names like 'tile::ground:

irt'
or even 'game::gui::tile::ground:

irt'.