| |
| Posted by forkit in reply to mw | PermalinkReply |
|
forkit
| On Friday, 10 June 2022 at 20:59:38 UTC, mw wrote:
>
> ..
> D is supposed to be a better OO language (read: encapsulation, separation of concerns), and DMD is developed by a number of highly capable very experienced D developers (read: not ordinary programmers), how come DMD is in such a terrible state as if it's done by some average Joel (above)?
>
> No offense, I am just puzzled by this software engineering myth.
Nonsense. D .. a better OO langauge??
Do you even know how hard it is, to reason about a D module?
The D module is, apparently, THE single most important abstraction for encapsulation - someone decided to design it this way.
This conflicts with OO principle of being able to encapsulate an objects invariants in its specification. So D, a -betterOOP .. hah!
The D module is designed to encourage shared mutability. There are no means to specifiy, let alone verify and enforce, encapasulated object invariants. They have no 'boundary' inside a D module - by that I mean, any other code in the same module can transgress any boundary that has been specified.
The D 'supremecy' of the D module, encourages exactly what it going on the dmd and phobos source.
Co-operative mutability, is a major source of bugs - always has been, always will be (cause it makes it so difficult to reason about code).
Mutable state subverts encapsulation, makes it more difficult to reason about code, and makes it difficult to scale 'correct' code.
Mutabilty is certainly 'convenient', and oftne necessary, especially in low-level code, but it needs to be approached with greater caution than is what demonstrated in D's source code.
D's module is the result of imperative, co-operative mutability, thinking, not OO thinking.
Please drop this idea, that D is a better OO langauge. It is not.
|