# Blog Post: No Namespaces in Rust is a Feature

**URL:** <https://internals.rust-lang.org/t/blog-post-no-namespaces-in-rust-is-a-feature/13040>\
**Category:** cargo\
**Created:** [September 10, 2020, 11:36pm UTC](https://internals.rust-lang.org/t/blog-post-no-namespaces-in-rust-is-a-feature/13040 "2020-09-10T23:36:37Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![infogulch](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/infogulch/32/4912_2.png) [@infogulch](https://internals.rust-lang.org/u/infogulch)\
**Post date:** [September 18, 2020, 10:57pm UTC](https://internals.rust-lang.org/t/blog-post-no-namespaces-in-rust-is-a-feature/13040/13 "2020-09-18T22:57:51Z")

</div>

> [@jtgeibel](#):
>
> I don't think namespacing does much to address name squatting (_we would need to have similar rules to the above to protect the namespaces themselves_).

(emphasis mine)

If I may articulate it in my own words:

In computer science-y terms, the primary benefit that namespaces provide is that they reduce the complexity of dealing with the name squatting problem from `O(N)` to `O(1)`. Given `N` crates that an individual wants to publish, without namespaces requires solving that problem `O(N)` times -- once for each crate, whereas with namespaces that problem is reduced to constant time `O(1)` because after you find _just one_ suitable namespace the naming conflicts problem caused by other users holding names vanishes in the context of that namespace.

The problem of choosing a name is enormous; it includes squatting, but also includes typical practical problems like discoverability, popularity, memorability, trust, etc., all things us mortals will not "solve" any time soon. **There are an endless array of variables that contribute to the complexity of choosing crate names. Namespaces at least enable us pull a factor of `N` out of it.**

To be specific, I think the community should strive to realize the factor of `N` complexity savings that something like namespaces provides, but it's not clear to me that "namespaces" as [commonly conceived](https://internals.rust-lang.org/t/pre-rfc-user-namespaces-on-crates-io/12851) is the best formulation.

### Addendum

This `O(N)` -\> `O(1)` reduction argument is applicable to both perspectives mentioned in the blog post:

- Validating common authorship among crates - namespaces are valuable here because complexity of validating the authorship of each individual crate to just doing it once
- Avoiding naming conflicts - namespaces are valuable here because it reduces the complexity of choosing a name out of a crowded space to just doing it once

---

_[View the full topic](https://internals.rust-lang.org/t/blog-post-no-namespaces-in-rust-is-a-feature/13040)._
