• fruitcantfly@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    3 hours ago

    With Rust you safe 1 char, and gain needing to skip a whole line to see what type something is.

    Honestly, the Rust way of doing things feels much more natural to me.

    You can read it as

    1. Define a function,
    2. with the name getoffmylawn,
    3. that takes a Lawn argument named lawn,
    4. and returns a bool

    Whereas the C function is read as

    1. Do something with a bool? Could be a variable, could be a function, could be a forward declaration of a function,
    2. whatever it is, it has the name getoffmylawn,
    3. there’s a (, so all options are still on the table,
    4. ok, that’ a function, since it takes a Lawn argument named lawn, that returns a bool