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?
Method chaining is the design pattern of returning
selffrom a method to allow repeated calls: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?