On Monday, February 20, 2017 at 2:21:27 AM UTC, Lucas Desgouilles wrote:
>
> I don't see why you should seek correctness of the integer division 
> function if you explain the case when used with 0 in the documentation. 
> Besides, most code checking before n//0 would just use 0 as a replacement 
> for that value.
> No exceptions, no bugs, just mathematically incorrect.


I think it is the 'quiet failure' that bothers me. Also, all the effort 
that goes into creating a language with a type system that is designed to 
help prevent errors and then one very obvious kind of error we just throw 
the towel in and give up.

YourHealthPen Inc. make a smart health device for diabetics. It monitors 
your levels and uses smart analytics on past behaviour to determine the 
best dose of insulin to give you. As it has a snazzy touch screen with a 
nice UI, the developers chose to write it in Elm. It calculates the dosage 
of insulin to give you and as it pumps it out it calculates the amount to 
subtract from the total in each time internal, then subtracts until it 
reaches zero. Unforetunately there is a bug with low enough probability 
that it makes it through testing, but then still shows up in the real 
world; divide by zero produces zero in some cases, so zero is subtracted 
from the total, and the device continues to pump until all the insulin is 
spent. In some cases now making headlines around the world - a fatal dose.

However, the type system in Elm does ensure that the UI runs glitch free 
;-) Get yours today!

 

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to