First Draft: Static Single Assignment

Jonathan M Davis newsgroup.d at jmdavisprog.com
Fri Dec 5 06:48:47 UTC 2025


On Thursday, December 4, 2025 6:35:00 PM Mountain Standard Time Walter Bright via dip.development wrote:
> I appreciate your sentiment, Jonathan, but all I can say is give it a try and
> see how it feels. I bet you'll like it! I know I'm looking forward to using it.

Honestly? I'm already of the opinion at this point that const is almost
always a waste of time and that immutable is really only of value, because
it helps write thread-safe code. There's no way that I'm going to be using a
storage class just to try to catch when a variable gets assigned to or
mutated. If I thought that that had much value, I'd already be using const
in most such cases, whereas in practice, I've found that const just actively
gets in the way (particularly with user-defined types, and pretty clearly,
for structs - which I use _far_ more than classes - final won't be any
different).

const is much less of an issue with primitive types, but I'm also not sure
that I've _ever_ caught a bug in code thanks to const. So, I've gone from
being really glad that D had const unlike Java to coming to the conclusion
that const's only real value is in making it so that the same piece of code
can use a mutable and immutable object, and aside from virtual functions,
that can generally be done just fine with a templated function.

So, if folks want to use final, that's fine (and clearly, some folks like
the idea), but I truly don't see the value. It just seems like yet another
complication being added to the language while not really doing much. And D
is already a very complex language.

- Jonathan M Davis






More information about the dip.development mailing list