Why static analysis is the way to go

H. S. Teoh hsteoh at qfbox.info
Sat May 30 14:11:50 UTC 2026


On Sat, May 30, 2026 at 10:55:41AM +0000, Nick Treleaven via Digitalmars-d wrote:
> On Saturday, 30 May 2026 at 06:43:13 UTC, Meta wrote:
> > On Saturday, 30 May 2026 at 06:14:25 UTC, monkyyy wrote:
> > > a) exceptions airnt useful
> > 
> > I dunno why everyone hates exceptions. They're incredibly useful,
> > and generally significantly reduce the complexity of your code. Like
> > pretty much everything in programming, misusing them will of course
> > cause major issues.
> 
> Far too easy to forget that calling a function may throw an exception.
> And 'misuse' is so widespread, it's even in Phobos with auto-decoding.

Auto-decoding is widely regarded as a mistake, as is throwing an
exception during Unicode decoding.

But I also find exceptions useful -- when used properly, for actual
exceptional situations, not a lazy way of returning a failure value.
The current *implementation* of exceptions via libunwind may not be
ideal, but the concept IMO is sound.


T

-- 
What starts with O and ends with NIONS and sometimes makes you cry?  Opinions.


More information about the Digitalmars-d mailing list