Not using namespaces

C

coal

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.
 
J

Jim Langston

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.


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.
 
R

red floyd

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?
 
B

BobR

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!!
 
C

coal

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,474
Latest member
AntoniaDea

Latest Threads

Top