No reason to avoid single-segment namespaces. by llasram · Pull Request #100 · bbatsov/clojure-style-guide (original) (raw)
Single segment namespaces have problems in ClojureScript as well.
[David Nolen] Compiler support for single segment namespaces has always been spotty and there's no intention to improve it. There are fundamental semantic issues - for example if you have a DOM element with a CSS id and you haven't supplied a namespace but you goog.require one with that name it will return the DOM element. Good luck debugging that.
Single segment namespaces are nearly alway representative of a problem waiting to manifest. If you want to use them then you can suppress the warning in your build options.
You'll get warnings in ClojureScript by default when compiling single segment namespaces.
IMO everything in the design of Clojure, the JVM, and ClojureScript seems to be pushing away from single segment namespaces. The only benefit from single segment namespaces (I think?) is a slightly more elegant ns declaration. While that's nothing to be sniffed at, IMO it's not a big enough gain. People can do whatever they want in their own code, but in the de facto style guide for Clojure, I think single segment namespaces should be avoided.