A reasoned critique of the often lauded with keyword that can be summarized as:
Return values from different expressions in a
withblock can only be distinguished by the shape of the data returned. This creates ambiguity inwith’selseclauses that make code harder to understand and more challenging to modify correctly.
The author describes the problem in detail and even provides two alternatives to with..else that avoid the resulting ambiguity.
Discuss on Changelog News