On Saturday, 2 August 2014 at 20:04:32 UTC, Johannes Pfau wrote:
Am Sat, 02 Aug 2014 12:19:41 -0700
schrieb Walter Bright <newshou...@digitalmars.com>:
On 8/2/2014 6:20 AM, Artur Skawina via Digitalmars-d wrote:
> The bug was _introduced_ by the assert, the code was 100%
> correct.
Asserts are part of the code, and writing incorrect asserts is
writing buggy code.
And you still think that changing the behavior of assert is a
good
idea? Even if assert was always meant to work like this, even
if the
spec clearly defined it this will be a PR disaster. People
don't care
what was in the spec, the only thing they know is the code
worked
before, now it doesn't work anymore ==> blame it on the
compiler/language.
I don't buy this!
JoeCoder: "Boss, I'm not able to run my code with without
-release in development, because every few milliseconds an assert
is triggered, but with that switch used to be very fast apart
some crash and silly behaviour from time to time in production.
But now I've upgraded the compiler and the bad boy working on the
D language has ruined all my work!"
Boss:"Stick with the old compiler version, light more candles in
the Charles Babbage Altar, and you are sacked!"
Just envision the situation when somebody post on reddit 'My
code has
been broken by this compiler release' then spents quite some
time to track it down and complains about the assert changes?
Will you
then reply 'You're code was broken anyway'?
This should be a big YES.
What about Scott Meyers basically telling us that we should
make the
language 'predictable' for the users? Doesn't the existence and
size of
this discussion already prove that making assert work like
assume will
be unexpected for many people? You even admitted that in other
languages assert has a different meaning. You argued against
the name
'volatile' cause it has a different meaning in other languages.
How
does this not apply to assert/assume? You might ask for Scotts
opinion
about this case if you don't believe the people in this thread.
I understand the debate of introducing assume, and keep the two
face of the medal split, but I think that there's nothing not
predictable in the fact that, if an assert is there, everyone
ranging from the optimiser to the colleague reading the sources
is expecting that the expression must be true, without doubt.
That's the predictable behaviour.
---
Paolo