Skip to content

Consider implementing method chaining design pattern #782

@MicahGale

Description

@MicahGale

Method chaining is the design pattern of returning self from a method to allow repeated calls:

mat.add_component("h-1", 0.6667).add_component("o-16" 0.333)

This can lead to compact code, that sometimes can be more readable. It has also been criticized as a "train wreck", and I see it in Java often. My rule of thumb is: if Java does it; beware.

Is this worth doing @tjlaboss?

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestAn issue that improves the user interface.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions