Re: The art of naming namespaces [was: Re: algorithms namespace]

From: Thorsten Ottosen [mailto:nesotto@cs.auc.dk]
I'd say that for boost::filesystem, Dave's suggestion "files" would be a great compromise.
Why plural? We seldom name class in plural.
Good question, and I'm not really sure I can answer it very well (but I'll try): * It can be mentally expanded to files...ystem. * Some names work "best" in plural (like signals, type_traits, iterators, operators); this is of course very much IMHO. * Just "file" seems a bit restrictive to me, but when I think about the namespace "files" I read "files 'n other related stuff, too". (Come to think about it, that Boost.Thread uses the singular form is actually quite funny!) As this is a highly subjective matter, I don't consider these arguments/reasons to be anything else than personal opinions. Bjorn

<Bjorn.Karlsson@readsoft.com> wrote in message news:3D8559AE95B4D611B02C0002557C6C8BA4DB73@STH-EXCH...
From: Thorsten Ottosen [mailto:nesotto@cs.auc.dk]
I'd say that for boost::filesystem, Dave's suggestion "files" would be a great compromise.
Why plural? We seldom name classes in plural.
Good question, and I'm not really sure I can answer it very well (but I'll try):
* It can be mentally expanded to files...ystem.
then fs is better IMO.
* Some names work "best" in plural (like signals, type_traits, iterators, operators); this is of course very much IMHO.
are they the names of namespaces?
* Just "file" seems a bit restrictive to me, but when I think about the namespace "files" I read "files 'n other related stuff, too".
then maybe it should be namespace io? Just like a big namespace for algorithms, io could hold file handling, zip streams, formatters etc. br Thorsten

On Wed, 25 Feb 2004 23:22:00 +1100, Thorsten Ottosen wrote: [on the name of the filesystem namespace]
then maybe it should be namespace io? Just like a big namespace for algorithms, io could hold file handling, zip streams, formatters etc.
Much as I said I didn't really care before, this one feels like it is the right sort of area. It's my favourite of the ones I've seen so far, and is much better than anything I could come up with. I think most people would understand "io" as an abbreviation with no real potential for confusion. (And if they are confused, I hate to think what they will think an "iostream" is.) If the stuff ever made it into the standard, then you'd get "std::io" which would make ex-C programmers happy too. So, do we move filesystem to boost::io::filesystem? :-) phil -- change name before "@" to "phil" for email

Phil Richards wrote:
I think most people would understand "io" as an abbreviation with no real potential for confusion. (And if they are confused, I hate to think what they will think an "iostream" is.) If the stuff ever made it into the standard, then you'd get "std::io" which would make ex-C programmers happy too.
and yet...I associate 'io' with reading and writing, i.e. things related to some *content*, while in boost::filesystem we are more talking about content *containers* and how to deal with them. Regards, Stefan

On Wed, 25 Feb 2004 13:36:16 -0500, Stefan Seefeld wrote:
and yet...I associate 'io' with reading and writing, i.e. things related to some *content*, while in boost::filesystem we are more talking about content *containers* and how to deal with them.
I know what you mean - I had the same feeling. However, taking a step back and thinking "this namespace is the generic place to put things to do with I/O" made me less bothered about it. The class names within the namespace should, of course, make sense - but filesystems only make sense when viewed in the larger context of I/O. phil -- change name before "@" to "phil" for email

Phil Richards wrote:
On Wed, 25 Feb 2004 13:36:16 -0500, Stefan Seefeld wrote:
and yet...I associate 'io' with reading and writing, i.e. things related to some *content*, while in boost::filesystem we are more talking about content *containers* and how to deal with them.
I know what you mean - I had the same feeling. However, taking a step back and thinking "this namespace is the generic place to put things to do with I/O" made me less bothered about it. The class names within the namespace should, of course, make sense - but filesystems only make sense when viewed in the larger context of I/O.
only if you take 'I/O' in a broad sense. I may check file stats for a lot of reasons beside I/O, such as to execute a file, or finding out where I am. In C++ I usually associate I/O only with streambuffers and streams. Stefan

On 2/25/04 3:36 PM, "Stefan Seefeld" <seefeld@sympatico.ca> wrote:
Phil Richards wrote:
On Wed, 25 Feb 2004 13:36:16 -0500, Stefan Seefeld wrote:
and yet...I associate 'io' with reading and writing, i.e. things related to some *content*, while in boost::filesystem we are more talking about content *containers* and how to deal with them.
I know what you mean - I had the same feeling. However, taking a step back and thinking "this namespace is the generic place to put things to do with I/O" made me less bothered about it. The class names within the namespace should, of course, make sense - but filesystems only make sense when viewed in the larger context of I/O.
only if you take 'I/O' in a broad sense. I may check file stats for a lot of reasons beside I/O, such as to execute a file, or finding out where I am. In C++ I usually associate I/O only with streambuffers and streams.
I was thinking this way too when coming up with the I/O namespace. But I don't object strongly to moving the file-system stuff there. (So in the voting number system, I'm -0.) -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com

"Phil Richards" <news@derived-software.ltd.uk> wrote in message news:20040225182859.C873D8C016@derisoft.derived-software.demon.co.uk... [snip] people would understand "io" as an abbreviation with no
real potential for confusion. (And if they are confused, I hate to think what they will think an "iostream" is.) If the stuff ever made it into the standard, then you'd get "std::io" which would make ex-C programmers happy too.
So, do we move filesystem to boost::io::filesystem? :-)
Will the extra 'filesystem' namespace be necessary? br Thorsten

On 2/25/04 8:16 PM, "Thorsten Ottosen" <nesotto@cs.auc.dk> wrote:
"Phil Richards" <news@derived-software.ltd.uk> wrote in message news:20040225182859.C873D8C016@derisoft.derived-software.demon.co.uk... [snip]
people would understand "io" as an abbreviation with no real potential for confusion. (And if they are confused, I hate to think what they will think an "iostream" is.) If the stuff ever made it into the standard, then you'd get "std::io" which would make ex-C programmers happy too.
So, do we move filesystem to boost::io::filesystem? :-)
Will the extra 'filesystem' namespace be necessary?
Earlier in this thread, didn't we say that a third namespace level should be avoided? -- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com

I wrote:
So, do we move filesystem to boost::io::filesystem? :-)
On 2/25/04 8:16 PM, "Thorsten Ottosen" <nesotto@cs.auc.dk> wrote:
Will the extra 'filesystem' namespace be necessary?
On Sun, 29 Feb 2004 08:21:04 -0500, Daryle Walker wrote:
Earlier in this thread, didn't we say that a third namespace level should be avoided?
I draw attention to the smiley at the end of the line with the suggestion. No, whatever namespace is eventually deemed appropriate, a third level should not be introduced. phil -- change name before "@" to "phil" for email

Phil Richards <news@derived-software.ltd.uk> writes:
Much as I said I didn't really care before, this one feels like it is the right sort of area. It's my favourite of the ones I've seen so far, and is much better than anything I could come up with.
I think most people would understand "io" as an abbreviation with no real potential for confusion. (And if they are confused, I hate to think what they will think an "iostream" is.) If the stuff ever made it into the standard, then you'd get "std::io" which would make ex-C programmers happy too.
So, do we move filesystem to boost::io::filesystem? :-)
Exploring the filesystem is, IMO, conceptually different from doing I/O. -- Dave Abrahams Boost Consulting www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> wrote in message news:ubrnle90i.fsf@boost-consulting.com...
Phil Richards <news@derived-software.ltd.uk> writes: [snip]
So, do we move filesystem to boost::io::filesystem? :-)
Exploring the filesystem is, IMO, conceptually different from doing I/O.
At least one other language does think so: http://java.sun.com/j2se/1.5.0/docs/api/java/io/File.html I agree with you that there is a conceptual difference, but I think the difference is within the very broad category of io. Afterall, data from the filesystem propagates into the running program as a form of input or you may write a new file which is a form of output. br Thorsten

[I sent this a couple of days ago but it appears to have got lost in the ether...] On Thu, 26 Feb 2004 18:06:05 -0500, David Abrahams wrote:
Exploring the filesystem is, IMO, conceptually different from doing I/O.
The keyword there is "doing". I agree with your statement, I just don't necessarily agree with the implication that naming the namespace "io" means everything in the namespace is "doing" I/O. I would read it as "related to I/O". Filesystems are related to I/O, otherwise they serve no point. boost::filesystem is about exploring _and_ modifying the underlying filesystem; quite where you draw the line between an action being "filesystem" related and I/O related is seems to be a bit fuzzy - creating a file modifies the filesystem (hence filesystem::fstream) and this involves I/O. So does the directory creation stuff. I suspect that a move to "io" as a namespace would also require the class names to change if things are to read correctly: boost::filesystem::path p; is nice, but boost::io::path p; loses something. Or maybe drop boost::io as an idea... Obviously, if other people read "io" to mean "doing I/O" then the name is bad, so my justifications aren't much use, and any further ponderings can be elided :-) phil -- change name before "@" to "phil" for email

Phil Richards wrote:
Filesystems are related to I/O, otherwise they serve no point.
uh, you could say the same about computers, too. Obviously, everything is somehow related. Pushing the abstraction this far is IMO just one step too far. Stefan

Stefan Seefeld wrote:
Phil Richards wrote:
Filesystems are related to I/O, otherwise they serve no point.
uh, you could say the same about computers, too.
Great idea! We should put everything in "boost::comp" for "computational notions." ;-)
Obviously, everything is somehow related. Pushing the abstraction this far is IMO just one step too far.
I agree, and agree with David Abrahams in that "io" indeed indicates the input or output of data, which is quite different from the hierarchical beast called a file system... /David

On Mon, 01 Mar 2004 14:04:02 -0500, David Bergman wrote:
Stefan Seefeld wrote:
Phil Richards wrote:
Filesystems are related to I/O, otherwise they serve no point. uh, you could say the same about computers, too. Great idea! We should put everything in "boost::comp" for "computational notions." ;-)
Except that I/O isn't a computational notion, so that would be rather bogus. Let's got off this subject... it is way off topic. I'm really not fussed about what the abbreviated name is: I don't particularly like "fs", and "files" probably suffers from similar problems to "io" in terms of being misinterpreted.
Obviously, everything is somehow related. Pushing the abstraction this far is IMO just one step too far. I agree, and agree with David Abrahams in that "io" indeed indicates the input or output of data, which is quite different from the hierarchical beast called a file system...
...which is made up entirely of files that are created with I/O, and provides an abstraction of the hierarchy of these files so that you can read and write more of them using file I/O, and exists purely to hold files that are created and read by file I/O. And, of course, the boost::filesystem namespace contains classes for the reading and writing of files, too. Let's just leave it as "boost::filesystem"... phil -- change name before "@" to "phil" for email

"Thorsten Ottosen" <nesotto@cs.auc.dk> writes:
* Some names work "best" in plural (like signals, type_traits, iterators, operators); this is of course very much IMHO.
are they the names of namespaces?
tuples is. It allows us to have the name "tuple" for the class template directly in boost. -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (7)
-
Bjorn.Karlsson@readsoft.com
-
Daryle Walker
-
David Abrahams
-
David Bergman
-
Phil Richards
-
Stefan Seefeld
-
Thorsten Ottosen