POV-Ray : Newsgroups : povray.general : Script language speed : Re: Script language speed Server Time
7 Aug 2024 11:22:52 EDT (-0400)
  Re: Script language speed  
From: Jon A  Cruz
Date: 8 Nov 2001 11:17:12
Message: <3BEAAFC2.8E01E69E@geocities.com>
Redbeard wrote:

> "Jon A. Cruz" <jon### [at] geocitiescom> wrote in message
> news:3BE9710A.59F6A388@geocities.com...
>
> > Anyway, I find it more usefull than C++ namespaces where you have a single
> > top-level collection of naming shared by the entire world. Among other things,
> you
> > start to see names decorated with package naming like:
> >
> > xmlSaxParser thing = new apacheXercesSAXParser();
> >
> > And don't get the option of short-cutting.
> >
> Actually, C++ namespaces are more useful than that.  Unfortunately, they are not
> wide implemented (properly) yet.  It would be more like[1]:
>     namespace apache_Xerces
>     {
>         class SAXParser ...
>     }
>     ...
>     [other file]
>     using apache_Xerces::SAXParser; // SAXParser can be used undecorated.
>     using namespace apache_Xerces;  // Imports entire namespace.

Ahh, but what you see there is just a single name that lives in the top-level
namespace. (terms are just close, probably not precise to the actual ANSI spec).

You just put an underscore in the middle of that namespace. With Java, you could
have "org.apache", "org.apache.xerces", "org.apache.xml", each one being the
equivalent of nestled subdirectories. With C++ names, you'd have one top-level
directory with "apache", "apache_xerces" and "apache_xml" all living as
subdirectories in that main directory. In practice there's not so much difference,
but semanticly there is.

But I think the most important dinstinction is how those names are chosen. With
C++, each developer anywhere in the world picks what he hopes will be a short but
unique name for his work. Pick the same name for a namespace as someone else, and
you'll have trouble if you ever try to integrate with his code. But the Java trick
of standardizing on reversed domain names solves that problem quite nicely, and on
a world-wide basis.

--
Jon A. Cruz
http://www.geocities.com/joncruz/action.html


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.