Skip to content

The Semantic Rule for { } VS do/end #162

Closed
@jimweirich

Description

@jimweirich

The style guide suggests using {...} for single line and do/end for multiple line blocks.

Is it worth mentioning the semantic rule for choosing {} VS do/end as another possibility? The semantic rule says use {} for blocks where the primary purpose of the block is to return a value, use do/end for blocks where the primary purpose of the block is to execute side effects.

Although a minority style choice, the semantic rule does have a significant following:

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