Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent dash (-) and underscore (_) usages in Cargo package names #1709

Closed
tatsuya6502 opened this issue Dec 22, 2018 · 1 comment
Closed

Comments

@tatsuya6502
Copy link

tatsuya6502 commented Dec 22, 2018

I found that some of the Cargo packages in this book have dashes (-) in their names while others are having underscores (_).

Chapter Cargo Package Name
1 hello_cargo
2 guessing_game
7 my-project
14 add-one
19 hello_macro, hello_macro_derive

I think dashes are generally preferable over underscores for Cargo package today, so we might want to use dashes for all these packages?

"Is it good practice to call crates “hello-world”, “hello_world” or does it not matter?"

The - to _ thing didn’t always exist, so you’ll see a lot of earlier projects use _. The convention is generally to use -.

@carols10cents
Copy link
Member

Thanks for the suggestion! There are enough crates that use either hyphen or underscore though that I think it's good to get people used to checking which a crate uses. Eventually, I hope that it shouldn't make a difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants