Re: How do you do "const nazi" in D?

2018-01-04 Thread Dukc via Digitalmars-d-learn
On Thursday, 4 January 2018 at 13:52:14 UTC, Mark wrote: You ma find Ali Cehreli's talk from DConf 2013 [1] useful. It includes some guidelines (basically recommendations) on how to use immutable and const. Same topic and same mentor here, but in text form:

Re: How do you do "const nazi" in D?

2018-01-04 Thread Mark via Digitalmars-d-learn
On Wednesday, 3 January 2018 at 17:27:38 UTC, Marc wrote: for a safe programming, since C/C++ times I try to make thing const as possible. locals, parameters etc anything which isn't going to change. How do you do that in D? immutable everywhere? for example: foreach(Field field;

Re: How do you do "const nazi" in D?

2018-01-04 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/3/18 12:27 PM, Marc wrote: for a safe programming, since C/C++ times I try to make thing const as possible. locals, parameters etc anything which isn't going to change. How do you do that in D? immutable everywhere? For parameters, I'd recommend const, not immutable, as const allows more

Re: How do you do "const nazi" in D?

2018-01-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, January 03, 2018 17:27:38 Marc via Digitalmars-d-learn wrote: > for a safe programming, since C/C++ times I try to make thing > const as possible. locals, parameters etc anything which isn't > going to change. > How do you do that in D? immutable everywhere? > > for example: > >