Cosmos-sdk: rename `x` to `modules`?

Created on 18 Apr 2020  Â·  15Comments  Â·  Source: cosmos/cosmos-sdk

Summary

Naming the modules folder x is confusing for people first encountering the Cosmos SDK.

Problem Definition

Make it more intuitive for new app-specific blockchain developers by using a folder structure that matches the architectural language used in the documentation and tutorial.

Proposal

Rename x to modules as referenced here.


For Admin Use

  • [ ] Not duplicate issue
  • [ ] Appropriate labels applied
  • [ ] Appropriate contributors tagged
  • [ ] Contributor assigned/self-assigned
proposal

Most helpful comment

Why is it confusing? It's pretty common in other libraries and languages. Regardless, we've been using the x/{name} nomenclature for so long now that it may cause more headaches and confusion.

All 15 comments

Why is it confusing? It's pretty common in other libraries and languages. Regardless, we've been using the x/{name} nomenclature for so long now that it may cause more headaches and confusion.

Seconded. modules makes way more sense than x.

(Just my 2p)

If this does get decided, it should happen before we wrap up protobuf (because we're using x in the package names). I kind of like the terseness of x/, but also do see why it's confusing. If others chime in that they would like it change, I guess I could back this but for now am leaning towards keeping it as is because we have enough things enough flux.

This is going to be a major PITA for all apps building on the SDK because they will have to migrate too. The renaming is just not worth it imho

This is going to be a major PITA for all apps building on the SDK because they will have to migrate too. The renaming is just not worth it imho

Well, they will have to migrate anyway due to the proto transition. And renaming x with modules is just a matter of a sed oneliner.

I'm not against keeping the x directory name as it is now in principle [1], surely the best time to rename is now - while SDK 1.0.0 is not yet out. If we wanted to do it, I'd do it now so that we can catch two birds with one stone.

[1] IIRC the historical reason behind the name x is simple: x stands for extension

I sum that if it needs to be done is done now.

It is always raised this question on why is named 'x', even in some youtube videos I saw in the past, so it must be confusing somehow.

How will we resolve this? A vote maybe?

Even if there is a vote, I doubt there would be enough buy-in or weight to truly reflect the scope/view of the community. I propose we leave it as-is.

I don't think we need to vote on this. Personally, mine is just a slight preference, but I'm fine with either really.

Why is it confusing? It's pretty common in other libraries and languages.

It is confusing because you have absolutely no idea what could be behind it when looking at a repo tree. So you need additional information (or just get used to it somehow) in order to understand it. I never came across it in any other ecosystem. It might be common in Go though, I don't know this ecosystem.

Sorry for opening a controversial first issue! I'm starting to go through the SDK tutorial for the first time to familiarize myself and making note of anything that's confusing on the initial pass.

The alternative is making the directory/file structure crystal clear in the docs and SDK tutorial because the current material had me chasing down this information in a few places before I was confident what was going on.

Opened a draft PR with a few edits that may be helpful: https://github.com/cosmos/sdk-tutorials/pull/302

Sorry for opening a controversial first issue!

No need to apologise at all! Thanks a lot for filing this and trying to help make Cosmos SDK better.

The alternative is making the directory/file structure crystal clear in the docs and SDK tutorial because the current material had me chasing down this information in a few places before I was confident what was going on.

That's a good alternative. Yet I believe that modules/auth is a more descriptive, better self-documenting package path name than x/auth. Like I and others said above, either we do it now or we'll keep it as it is ( either way won't be the end of the world).

It is confusing because you have absolutely no idea what could be behind it when looking at a repo tree.

Just because it's named /x/? I understand the argument, but it just doesn't feel like a solid one.

So you need additional information (or just get used to it somehow) in order to understand it.

Do you? It's something pretty trivial to grasp and get used to in a framework. Perhaps documentation could improve, but this has always been a standard in the SDK.

I never came across it in any other ecosystem. It might be common in Go though, I don't know this ecosystem.

It is. It's in Go's source code. Check it out. That being said, we're not enforcing apps to follow this structure. You can call your modules/packages whatever you'd like ;-)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

as the one who opened this issue. I'd be happy closing if the documentation made this a little more explicit.

Was this page helpful?
0 / 5 - 0 ratings