Skip to content

Incorrect claim abut dangling else problem in Rust? #65

@AlbertoGP

Description

@AlbertoGP

The fragment below from a review of Austral (“ALookAtAustral2023”) mentions a confusing claim about the dangling else ambiguitiy in other languages: the text seems to imply that it is a problem in Rust, but that is incorrect because they require braces around each branch.

“There are many good reasons to prefer the Rust approach: Programmers care a great deal about ergonomics. The dangling else is a feature of C syntax that has caused many security vulnerabilities. Try taking this away from programmers: they will kick and scream about the six bytes they’re saving on each if statement.” This is a weirdly bad example, given that Rust has taken the dangling else away and lots of people love it and most of the rest seem to not care either way.

The claim appears in the specification section “The cutting room floor”:
https://austral-lang.org/spec/spec.html#rationale-linear-cutting-room-floor

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