[Issue 21151] div bug: long -5000 / size_t 2 = 9223372036854773308
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Aug 13 19:57:53 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21151
--- Comment #12 from mw <mingwu at gmail.com> ---
for the additional reference, the forum discussion is here:
https://forum.dlang.org/thread/rdrqedmbknwrppbfixll@forum.dlang.org
Now both Java and C# did it more correct than D.
"""
At least I want a warning message, even with a turn-on command-line switch is
fine, I personally will turn it on all the time, silently performing this
conversions is horrible.
In many area of the language design, we need to make a choice between:
correctness v.s. raw performance.
But at least we also need *explicit* visible warning message after we've made
that choice:
-- especially warnings about *correctness* when the choice was made favoring
performance
-- if the choice was made favoring correctness, user will notice the
performance when the program runs.
Personally, I will favor correctness over performance in my program design
decisions: make it correct first, and faster later; you never know before-hand
where your program's bottleneck is.
I'm sure you know the famous quote:
"Premature optimization is the root of all evil!"
"""
--
More information about the Digitalmars-d-bugs
mailing list