Re: Using const to Enforce Design Decisions

2019-03-28 Thread Walter Bright via Digitalmars-d-announce
On 3/26/2019 12:57 AM, Marco de Wild wrote: I've also tried to use pure, but (ironically) I found it harder to use. I think it's easier to understand when an object will be mutated or not than to predict whether there are side effects. Using pure is indeed hard. One has to make a change in

Re: Using const to Enforce Design Decisions

2019-03-26 Thread Marco de Wild via Digitalmars-d-announce
On Monday, 25 March 2019 at 20:59:41 UTC, Rubn wrote: I guess obligatory http://jmdavisprog.com/articles/why-const-sucks.html Good to read a different take on the subject. Jonathan uses a lot of arguments that I recognize (and adds a few that I didn't encounter in my project). I am a firm

Re: Using const to Enforce Design Decisions

2019-03-25 Thread Rubn via Digitalmars-d-announce
On Monday, 25 March 2019 at 13:00:07 UTC, Mike Parker wrote: Marco de Wild has penned a tutorial on D's const for the D blog. He gives an overview of the feature, how it differs from C++, and shows how he employed it in his mahjong game. The blog: