"Exceptions will fade away in modern languages"

Paulo Pinto pjmlp at progtools.org
Wed Jan 6 07:40:21 UTC 2021


On Wednesday, 25 November 2020 at 17:15:14 UTC, Meta wrote:
> On Saturday, 21 November 2020 at 23:05:19 UTC, IGotD- wrote:
>> [...]
>
> This is well-trodden ground among D's competitors.
>
> Rust has no exceptions (only `panic`, which aborts the current 
> thread), and instead opts to use algebraic data types along 
> with some light language support. Swift does something very 
> similar.
>
> Go allows an optional return slot for an Error value that you 
> are not forced to check, as is typical for Go's approach of 
> choosing the worst possible option, but at least it's a slight 
> improvement on C. Get used to writing `if err != nil` every 
> other line.
>
> I think Nim actually does have exceptions.

Go's panic/recover mechanism are exceptions by another name.


More information about the Digitalmars-d mailing list