Worst ideas/features in programming languages?

max haughton maxhaton at gmail.com
Tue Oct 12 17:25:52 UTC 2021


On Tuesday, 12 October 2021 at 16:26:33 UTC, Paul Backus wrote:
> On Tuesday, 12 October 2021 at 16:19:42 UTC, Nick Treleaven 
> wrote:
>> On Monday, 11 October 2021 at 21:21:21 UTC, Paul Backus wrote:
>>> The real missing piece here IMO is DIP 1038 [1]. Once it is 
>>> fully accepted and implemented, defining a Result type will 
>>> be trivial.
>>
>> Could you explain how @nodiscard would help with sum types? 
>> Presumably it won't help to implicitly convert a subtype into 
>> the wrapper sum type?
>
> Currently, the big advantage exceptions have over sum types is 
> that you cannot accidentally ignore an exception. Either you 
> catch it, or it crashes your program.
>
> With `@nodiscard`, we can eliminate this advantage, and put sum 
> types and exceptions on an equal playing field.

One idea I had when bumping into this problem was something like 
a with statement but you give it some kind of composition 
operator, and then it joins the statements up implicitly a la do 
notation in Haskell


More information about the Digitalmars-d mailing list