Re: Setting field of struct object

2024-02-01 Thread TheTeaLady via Digitalmars-d-learn

On Monday, 22 January 2024 at 11:31:11 UTC, zjh wrote:

On Monday, 22 January 2024 at 08:54:54 UTC, zjh wrote:


```d
struct Person {
string name, email;
ulong age;
}
Person a{"n","email",33};
```



C++ can achieve ultimate `simplicity` without violating `DRY`,
And here, D violates the `DRY` principle!
Moreover, as the `package level, module level, class level, 
member level`, D language violates integrity.

Because D has no `class level` limit.
These are all not `serious states`.


Apparently comments about module visibility issues are no longer 
allowed on the D forum.


I wonder why your comment was not deleted though ??

No wonder there is now a fork of D.


Re: Setting field of struct object

2024-02-01 Thread TheTeaLady via Digitalmars-d-learn

On Monday, 22 January 2024 at 15:47:23 UTC, bachmeier wrote:

On Monday, 22 January 2024 at 15:45:45 UTC, zjh wrote:

On Monday, 22 January 2024 at 15:33:01 UTC, ryuukk_ wrote:

it only took me 1 project to never want to touch C++ again..



D language used to have no `copy constructor`, isn't it now 
added in again?


You have to admit the good aspects of `C++`.
You should take a look at the `latest C++`. C++ has already 
learned many advantages of `D`, but D has not made 
`significant progress`!
As a user, `C++` is really not much different from D, and even 
surpasses D `in many aspects`.
`RAII `, `variable parameter` template, `coroutine, concept`, 
`value semantics`, very easy to understand.
Moreover, the `inheritance` of C++ is very enjoyable to use in 
many aspects.


Sounds like you should be using C++. Why are you here?


Everyone who uses D should be welcome, even if they have a 
preference for another language, or a preference for features in 
another language.


This is how D will evolve and improve.

And this should include people who don't like the untyped 
universe of the D module (specifically, its lack of an optional 
mechanism for information hiding within a module). People can 
think of it as if it were typed, but this is just an illusion. 
This illusion can easily lead to type confusion and inconsistent 
and erroneous interactions - i.e. bugs.
To avoid this in D one needs to literally reorganise that untyped 
universe into into a typed system. Now your types impose 
constraints which will help to enforce their correctness. 
Organisation is important of course, but for using types in D, 
its vital - if strong typing is your objective.


I think D is clumsy in many other areas as well.

btw. I too prefer multiple inheritance.