Is there any real reason to use "const"?

rempas rempas at tutanota.com
Tue Jan 25 11:40:18 UTC 2022


On Tuesday, 25 January 2022 at 10:42:35 UTC, bauss wrote:
> Sure thing but that's not realistic if you work professionally 
> as you might be handed code that 15 other people worked on for 
> a decade before you.
>
> You will not be able to reason about the memory properly, in 
> which case if certain variables are marked with const it will 
> tell future people that this is read-only memory.

Yeah, the problem with me is that I almost thing about the most 
cases when you work alone or with good people but never cases 
like the one you described. The others did an amazing job explain 
that to me. That and the fact that humans do mistakes even when 
they know what they are doing...


More information about the Digitalmars-d mailing list