Let me offer a perspective coming from a Java background:

I know that there are subtle differences between a namespace and a
Java package, but I still tend to subconsciously consider them
analogous: they are container structures for organizing code. The code
itself (Java classes, or Clojure files with similarly-grouped
functions in a namespace) gets organized into these containers. With
this mindset, I've always found it a little counter-intuitive that
all  .clj files belonging to a particular namespace aren't stored in
the same directory*. (This also helps a bit with organization at the
file level).

I think the biggest pragmatic difference boils down to the package/
namespace "bootstrapping." In Clojure, there is one file that "owns"
the lib and declares the namespace with (ns) and manually loads the
others, which include themselves in the namespace with (in-ns). In
Java, every class declares the package, and any can stand alone to
"bootstrap" the package (and Java itself loads the classes in).

Now I'm not necessarily advocating to change Clojure namespaces to
follow Java packages, but it is a subtle paradigm shift for people
coming from Java that seems to regularly pop up as a point of
confusion.

* Technically, this isn't required even by the Java spec but I've
never seen it done otherwise.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to