473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Not using namespaces

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
4 1507
<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
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

<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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
4
by: Cybertof | last post by:
Hello, What is the difference between : - adding a new reference to a namespace within the SolutionExplorer (right click, Add Reference...) - adding a new reference with the 'using' keyword in...
3
by: xzzy | last post by:
I was wondering why we have to have using System.Data using System.Configuration using etc.... why are they not all lumped into one 'using'? In other words, is there a best way to use...
3
by: Yair Cohen | last post by:
hello 1 i use an xml documet with xml schema but when i try to use XPath (selectnodes) it retrieves empty list. when i remove the schema (the 'xmlns="http..."') i get the data. how can i handle...
6
by: Juha Nieminen | last post by:
Whenever one sees example C++ code basically anywhere, be it in a book, in a tutorial in the internet, in an online forum or whatever, I would estimate that at least in 99% of cases one sees the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.