Skip to content

Commit c367e69

Browse files
committed
[Fix #100] Expand the rationale against single-segment namespaces
1 parent d00123e commit c367e69

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.adoc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,23 @@ Avoid single-segment namespaces.
610610
(ns example)
611611
----
612612

613+
Namespaces exist to disambiguate names. Using a single segment
614+
namespace puts you in direct conflict with everyone else using single
615+
segment namespaces, thus making it more likely you will conflict with
616+
another code base.
617+
618+
In practice this means that libraries should never use single-segment
619+
namespace to avoid namespace conflicts with other libraries.
620+
Within your own private app of course, you can do whatever you like.
621+
622+
TIP: It's common practice to use the convention `domain.library-name`
623+
or `library-name.core` for libraries with a single namespace in them.
624+
Read on for more coverage of the namespace naming topic.
625+
626+
There are https://github.com/bbatsov/clojure-style-guide/pull/100[other reasons]
627+
why might want to avoid single-segment namespaces, so you should
628+
think long and hard before making any use of them.
629+
613630
=== Namespace Segments Limit [[namespace-segments-limit]]
614631

615632
Avoid the use of overly long namespaces (i.e., more than 5 segments).

0 commit comments

Comments
 (0)