[RFC] Throwing an exception with null pointers
Richard (Rikki) Andrew Cattermole
richard at cattermole.co.nz
Mon Apr 14 14:22:09 UTC 2025
On 15/04/2025 1:51 AM, Atila Neves wrote:
> On Saturday, 12 April 2025 at 23:11:41 UTC, Richard (Rikki) Andrew
> Cattermole wrote:
>> I've been looking once again at having an exception being thrown on
>> null pointer dereferencing.
>> However the following can be extended to other hardware level exceptions.
>>
>> [...]
>
> I would like to know why one would want this.
Imagine you have a web server that is handling 50k requests per second.
It makes you $1 million dollars a day.
In it, you accidentally have some bad business logic that results in a
null dereference or indexing a slice out of bounds.
It kills the entire server losing you potentially the full 1 million
dollars before you can fix it.
How likely are you to keep using D, or willing to talk about using D
positively afterwards?
ASP.net guarantees that this will kill the task and will give the right
response code. No process death.
More information about the Digitalmars-d
mailing list