You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be good to add a check for making sure a method is immutable in terms of its inputs, with exceptions when required, notably for the first input of Modify methods that return void.
@IsakNaslundBh This is in theory easy to implement, but there could be edge cases where immutability is not always required, but only when a specific argument type is provided, for example, only for a bar that has a concrete section.
@alelom proposed that these edge cases may be simplified by always enforcing the cloning except for the first argument of Modify methods returning void. However, @IsakNaslundBh noted that this would incur in overhead in many situations. However, because immutability is mainly required from UI use, @alelom proposes that its responsibility is shifted to the UI (methods when invoked from an UI), to minimise the overhead. For methods invoking other methods, the responsibility could be of the implementation.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Logging a discussion we had with @IsakNaslundBh .
It would be good to add a check for making sure a method is immutable in terms of its inputs, with exceptions when required, notably for the first input of Modify methods that return
void
.@IsakNaslundBh This is in theory easy to implement, but there could be edge cases where immutability is not always required, but only when a specific argument type is provided, for example, only for a bar that has a concrete section.
@alelom proposed that these edge cases may be simplified by always enforcing the cloning except for the first argument of Modify methods returning void. However, @IsakNaslundBh noted that this would incur in overhead in many situations. However, because immutability is mainly required from UI use, @alelom proposes that its responsibility is shifted to the UI (methods when invoked from an UI), to minimise the overhead. For methods invoking other methods, the responsibility could be of the implementation.
Beta Was this translation helpful? Give feedback.
All reactions