January 02, 2008
On Wed, 02 Jan 2008 14:25:59 -0000, Daniel919 <Daniel919@web.de> wrote:
>
>
> My opinion
>
> is that const reads like: this will never change
> I know there is no difference between const,invariant,readonly,immutable,... in the English language.
> And that in C++ const also doesn't mean "this will never change".
>
My initial thought is oh no not again. It would be more productive to
leave thoughts about syntax to one side until the semantics are thoroughly
clear to everyone.
January 04, 2008
Bruce Adams wrote:
> On Wed, 02 Jan 2008 14:25:59 -0000, Daniel919 <Daniel919@web.de> wrote:
>>
>>
>> My opinion
>>
>> is that const reads like: this will never change
>> I know there is no difference between const,invariant,readonly,immutable,... in the English language.
>> And that in C++ const also doesn't mean "this will never change".
>>
> My initial thought is oh no not again. It would be more productive to
> leave thoughts about syntax to one side until the semantics are thoroughly
> clear to everyone.

I fully agree. The actual keywords are secondary to the semantics (of course), but in this case, I think we may experience something similar to the Stroop effect in psychology. Imagine trying to explain the colors of a painting to someone, but insisting on using the word "red" to mean blue and "blue" to mean red.

Of all the "synonyms" above, "constant" is the one understood by most people. Unfortunately, the D keyword "const" doesn't mean constant -- it means something different and another keyword means constant. This fact can't be very helpful in making the semantics thoroughly clear to everyone. :)

-- 
Oskar
January 04, 2008
Daniel919 wrote:
> But then it would be easier if we change:
> const to readonly
> invariant to const

I like this idea to exchange the meaning of const and invariant *VERY* much. Personally I prefer "invariant" to "readonly", but this is negligible.

The very nice side effect of this change would be, that we could kick the recent enum changes (which practically nobody likes *eg*), in favor to the much more intuitive and backward compatible "const PI = 3.14" form for manifest constants.

LLAP,
Sascha Katzner
1 2
Next ›   Last »