logoalt Hacker News

lolinder10/12/20241 replyview on HN

> In python for instance, the developer needs to be prepared to catch a divide by zero exception.

> In gleam, the same consideration is required but the implementation will just differ.

These aren't remotely the same. If a developer fails to catch an exception or a NaN then the program either crashes or returns an obviously wrong result. If a developer fails to guard against a zero returned from division then they get a number out that's wrong in subtle ways that may not be obvious until the wrong numbers are already in use somehow.

The question isn't whether you can work around the error, it's how likely you are to notice that you screwed something up before it's too late.


Replies

beanjuiceII10/12/2024

I'm with you on this for sure, seems dangerous to just use 0 how will anyone know something is going wrong?

show 1 reply