By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Not using namespaces

P: n/a
Does anyone ponder what life would be like if we
stopped using namespaces? Instead of
namespaces, a website could be used to propose/
register names. Namespaces were designed when
the internet was young and few understood how
things were changing. Today it is clear a website
could provide uniqueness and authoritative
information about names such as an overview and
where to find more information. The language would
be simplified by shedding the well-meaning but
convoluted rules pertaining to namespaces.

On comp.std.c++ a few weeks ago I replied to a loosely
related post by James Kanze and have copied some of
that here.
Context dependent keywords is a slippery slope, that I
don't think anyone really wants to go down. They make
understanding the language considerably more difficult.
I'm not crazy about how the language permits context
sensitive type name semantics. Some keywords are also
type names and those you can't "overload." Which way
is the standard heading? Will it someday be possible
to get rid of the big in bigint or should it go back to its
C roots in this respect?

I remember Stroustrup saying he didn't want UDTs to be
second class citizens. It seems in some ways the standard
went too far in that UDTs can be overloaded but the standard/
built-in types can't be. A new Boost library called Intrusive
originally had a type called ilist. In the review a number of
people said they preferred to change it to just list and use
namespaces to differentiate things. I said what if this library
becomes part of the standard? The reply was that std is
getting cluttered and should be segregated with namespaces.
If there are just two "list"s in std it isn't too bad, but the
slippery slope part comes in in that once you have more than
one there's no clear boundary. There could be proposals to
add more "list"s in the future and IMO that gets too confusing. You
have to be familiar with all of them to be sure you are
reading the code correctly.

Brian Wood
Ebenezer Enterprises
www.webebenezer.net

In God we trust -- United States national motto.

Jun 21 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
<co**@mailvault.comwrote in message
news:11**********************@n60g2000hse.googlegr oups.com...
Does anyone ponder what life would be like if we
stopped using namespaces? Instead of
namespaces, a website could be used to propose/
register names. Namespaces were designed when
the internet was young and few understood how
things were changing. Today it is clear a website
could provide uniqueness and authoritative
information about names such as an overview and
where to find more information. The language would
be simplified by shedding the well-meaning but
convoluted rules pertaining to namespaces.

On comp.std.c++ a few weeks ago I replied to a loosely
related post by James Kanze and have copied some of
that here.
>Context dependent keywords is a slippery slope, that I
don't think anyone really wants to go down. They make
understanding the language considerably more difficult.

I'm not crazy about how the language permits context
sensitive type name semantics. Some keywords are also
type names and those you can't "overload." Which way
is the standard heading? Will it someday be possible
to get rid of the big in bigint or should it go back to its
C roots in this respect?

I remember Stroustrup saying he didn't want UDTs to be
second class citizens. It seems in some ways the standard
went too far in that UDTs can be overloaded but the standard/
built-in types can't be. A new Boost library called Intrusive
originally had a type called ilist. In the review a number of
people said they preferred to change it to just list and use
namespaces to differentiate things. I said what if this library
becomes part of the standard? The reply was that std is
getting cluttered and should be segregated with namespaces.
If there are just two "list"s in std it isn't too bad, but the
slippery slope part comes in in that once you have more than
one there's no clear boundary. There could be proposals to
add more "list"s in the future and IMO that gets too confusing. You
have to be familiar with all of them to be sure you are
reading the code correctly.
I'm quite sure that if this boost ilist which they call list is going to be
added to the std library, they would not call it list but something else,
perhaphs even ilist.

Namespaces not only help in other's code but our own as well.
Jun 21 '07 #2

P: n/a
co**@mailvault.com wrote:
Does anyone ponder what life would be like if we
stopped using namespaces? Instead of
namespaces, a website could be used to propose/
register names. Namespaces were designed when
the internet was young and few understood how
things were changing. Today it is clear a website
could provide uniqueness and authoritative
information about names such as an overview and
where to find more information. The language would
be simplified by shedding the well-meaning but
convoluted rules pertaining to namespaces.
No offense intended, but this is a very ... crazy ... idea.

And what does the internet have to do with the C++ Language?
What if a developer doesn't have a 'net connection (cf. classified
development)? How would your proposed namespace database work?
Jun 21 '07 #3

P: n/a

<co**@mailvault.comwrote in message...
Does anyone ponder what life would be like if we
stopped using namespaces?
class A{ int number; };
class B{ double number; };

// error: conflicting types for `double number'
// error: previous declaration as `int number'

Looks dismal to me.

Nice try at a Troll though.
Try comp.std.c++ where the discussion is more On-Topic.
>
In God we trust - United States national motto.
<sarcasm>
Nope, can't use 'God' due to an single atheist troublemaker (freakin' jerk)
and a corrupt supreme court, reading 'single-sentences' instaed of 'whole
paragraphs' from our Constitution.
So, it's just: "In we trust" now.
[ Grrrrrrr!!! ]
Wait 'till the gov recalls the coinage to replace the word "God". You turn
in that nice proof gold coin (due to law), and get back a cheap piece of
tin! <G>
</sarcasm>
Ok, rant/troll over. Wake up, America!!

--
Bob R
POVrookie
Jun 21 '07 #4

P: n/a
On Jun 20, 7:20 pm, "Jim Langston" <tazmas...@rocketmail.comwrote:
I'm quite sure that if this boost ilist which they call list is going to be
added to the std library, they would not call it list but something else,
perhaphs even ilist.
If that is correct it would be helpful for both the users
and the author of the library to know that now. They are
going forward with the name list. If there is a definitive
answer on the subject I haven't heard it. But I vote for
ilist as well.

Brian Wood
www.webebenezer.net

Jul 3 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.