-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Comments section doesn't describe the multi-line comment syntax #693
Comments
Yes, this is on purpose. The Book is supposed to show idiomatic Rust, and to teach you the language, not show you every last nook and cranny of the language. Multi-line comments are not considered idiomatic, and so aren't described in the book. Thanks for reporting though! |
Interesting. Are there specific reasons for considering I'm asking since Describing the two Rust commenting styles is far away from showing 'every last nook and cranny of the language'. Omitting certain advanced features from an 'introductory book about Rust' is fine. But this section does more. It lists several false statements: 'In Rust, comments must start with two slashes and continue until the end of the line.' Wrong. Correct is: In Rust, comments may also start with 'That’s all there is to comments.' Wrong. Correct is: That isn't all there is to comments. There is more. There are 'They’re not particularly complicated.' Wrong. Correct is: |
@gsauthof I am new to Rust, so I cannot speak to why multi-line is considered non-idiomatic within Rust, specifically. However, I have noticed in the last few years, as generated documentation has become easier to implement, that there is an effort to make comments shorter and simpler. In fact, there is a mild rant against using too many comments within Python because user documentation can also be embedded within the code. I've seen similar suggestions with Javascript and creating JSDocs. These are higher level languages, but maybe the same thing is true for a "brand new" low level language like Rust? |
This is not consistent with Appendix B, where the block comments show up. Does that mean the appendix should be removed from the book? |
The Comments Section of the 2nd edition doesn't mention the
/* */
multi-line comment syntax:http://rust-lang.github.io/book/second-edition/ch03-04-comments.html
It even states:
And closes with:
But all this conflicts with the Rust reference:
https://doc.rust-lang.org/reference/comments.html
(which btw also mentions doc comments ...)
Rust seems to support multiline comments since 7 years:
rust-lang/rust#66
The text was updated successfully, but these errors were encountered: