A reasoned critique of the often lauded with keyword that can be summarized as:

Return values from different expressions in a with block can only be distinguished by the shape of the data returned. This creates ambiguity in with’s else clauses 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