It is the year 2020: why should I use / learn D?
Atila Neves
atila.neves at gmail.com
Sat Nov 17 15:19:43 UTC 2018
On Saturday, 17 November 2018 at 01:00:39 UTC, Jonathan M Davis
wrote:
> On Friday, November 16, 2018 3:41:10 PM MST H. S. Teoh via
> Digitalmars-d wrote:
>> On Thu, Nov 15, 2018 at 07:49:32PM -0700, Jonathan M Davis via
>> Digitalmars-d wrote: [...]
>>
>> > [...]
>>
>> Actually, immutable by default would encourage better coding
>> style, as well as potentially provide a small performance
>> benefit by allowing the optimizer to take advantage of more
>> things that don't need to be mutable (can elide certain loads
>> even in the face of aliasing, can infer more loop invariants,
>> etc.).
>
> immutable by default would encourage a functional programming
> style everywhere. I dispute that that's necessarily better.
> There are certainly times that that's better, but it's often
> hell. What we have now allows us to program functionally when
> we want to without forcing it, whereas having immutable by
> default would lean heavily towards forcing it.
Not forcing but encouraging.
> It also would not play well with D being a systems language
I can't see how - in Rust everything is immutable by default and
it's fine.
> or with D interacting with C or C++.
I also can't see how that'd be the case.
> Honestly, having D3 be const or immutable by default is the
> sort of choice that would make me seriously consider quitting D.
For me, the defaults should be @safe pure for functions and const
for variables.
More information about the Digitalmars-d
mailing list