Nice TWiki > Dev > AddingConstness (r1.3 vs. r1.4) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Dev . { Changes | Index | Search | Go }
 <<O>>  Difference Topic AddingConstness (r1.4 - 21 Nov 2003 - BrianSlesinsky)
Added:
>
>

I never much liked "const" as it exists in C++. The problem is that an object might appear to be mutable or immuable depending on where you are in the code. So a "const" object might change due to action somewhere else in the program.

Much better to have true immutable objects. Perhaps mutable and immutable versions of the same type, similar to !T and ?T.

Final instance variables in Java provide finer control since you can make an object partially immutable.

-- BrianSlesinsky - 21 Nov 2003


Topic AddingConstness . { View | Diffs | r1.4 | > | r1.3 | > | r1.2 | More }
Revision r1.3 - 18 Sep 2003 - 23:26 GMT - ArjanB
Revision r1.4 - 21 Nov 2003 - 07:40 GMT - BrianSlesinsky
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.