Skip to content

"Unsafe Ferris" may be misleading and/or a barrier to entry #2555

Closed
rust-lang/rust
#87312

Description

@adlerd

Currently the first (and only, for the first 18 chapters) definition someone reading the Book cover-to-cover will receive for "unsafe" is in the introduction section, like this:

Ferris will also help you distinguish **code that isn’t meant to work**:
...
This code block contains unsafe code.

I hope it's clear why this is not a good definition for "unsafe", but also it may be serving as an unnecessary barrier for people new to the language to feel that unsafe code is not an area they can ever become proficient in!

When considering ways this problem could be addressed; e.g. moving "unsafe Ferris" out of the table or some other way to clarify that the definition "code that isn't meant to work" doesn't apply to unsafe rust, I discovered that the attribute seems to only be used in chapter 19.1, titled "Unsafe Rust". My first suggestion then would be to just remove unsafe Ferris altogether; it doesn't seem to add much advantage over the appearance of unsafe keyword in the code and again may be disadvantaging people who try to interpret it without the background context long-time rustaceans have.

If there is interest in this idea I can open a PR to simply remove unsafe Ferris, but I didn't want to open such a PR without some kind of "ack" first since it could be taken the wrong way.

Activity

  1. carols10cents commented on Jul 9, 2021

    @carols10cents
    Member

    You're right, I've removed the unsafe Ferris designation. Thanks!

  2. added a commit that references this issue on Jul 20, 2021
    b41936b
  3. liby commented on Aug 9, 2021

    @liby

    @carols10cents
    I see doc.rust-lang.org hasn’t been updated yet. When will it be updated?

  4. carols10cents commented on Aug 9, 2021

    @carols10cents
    Member

    The book rides the release trains. https://doc.rust-lang.org/beta/book/ch00-00-introduction.html does have the update (note the "beta" in the URL) so https://doc.rust-lang.org/stable/book/ch00-00-introduction.html will be updated when the next release of Rust happens.

  5. liby commented on Aug 9, 2021

    @liby

    @carols10cents Thank you for answering my doubts.

  6. TheButlah commented on Dec 2, 2021

    @TheButlah

    Just wanted to say that I'd been scratching my head trying to find unsafe Ferris for a while, until I came across this issue. As a beginner I never felt like unsafe Ferris meant "code that wasn't supposed to work". It did mean to me that it was a prickly Ferris and should be handled with care - which is exactly how unsafe should be treated.

    Just my two cents - I think Ferris still belongs in that table, but the table should be re-framed from "icons indicating code doesn't work" to instead "helpful legends to navigate code samples"

  7. added a commit that references this issue on Mar 11, 2024
    4921fde
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions