Re: Do you currently use namespaces?
- Posted by Matt Lewis <matthewwalkerlewis at gmail.??m> May 26, 2008
- 1165 views
ken mortenson wrote: > > With regard to usage. Are we looking at the use of namespaces being > sort of all or nothing? I'm not saying it would be a requirement, but once > you start leaning on namespaces to solve collisions, you would tend to > have every include be given a name? It's not a requirement, though some people already code this way. Namespaces are the way in which you can resolve a collision. There's also going to be the ability to specify a default namespace for your library, which users could use. > Will there be instances where you didn't give an include a namespace and > find that later you must? Like adding a new lib to your project? This may > not be a top level include, requiring a hunt through who knows how many > files (depending on project size.) Yes. If you didn't specify a namespace, it's very possible that a later addition to your application could conflict with some other symbol that didn't need any qualifier previously. > While the usage may be consistant, you might have an issue with consistant > usage? I suspect I'm not being clear. Yeah, I'm not even trying to parse that one. :) > It's just my gut, but this paradigm may not be resolvable regardless of > the fineness. I believe there is a fundamental flaw in the concept of > trying to fix the issues inherent with using includes as the application > gets more complex. I know that classes resolves the issue. The problem > of course is implementing classes when you are on track to use includes. > > I need to be more specific of course, but I need to think for awhile. Classes only resolve the issue until you have multiple classes with the same name. I disagree with the main assertion, however. I believe that at this point it is totally possible to resolve any conflict with the tools that we have. By this, I mean that it should be possible to combine any [working!] third party code into a single application without having to modify any of the third party code. The information hiding is actually not *required* for this, though it could make the job easier by reducing the amount of symbols available to any particular scope. Matt